mark.ie: My Approach to PatternLab?

My Approach to PatternLab?

I’m sometimes asked for an overview of my general approach to PatternLab. Simple: put everything for each component in the same directory!
markconroy
Fri, 05/18/2020 – 15:43

When working with PatternLab, which I use for all my Drupal maintenance support plans themes, including the theme for this website, I don’t use the full atomic approach. I don’t use the approach of atoms > molecules > organisms > etc. I’m sure many people seriously disagree with me for that ( I do think it’s a very clever concept). Instead I’ve renamed things to match the language we use with our clients.

I tried talking about atoms and molecules to some clients and their eyes glazed over. Clients do not want a science lesson. They do not want to be told that we are going to take two of these atoms, and mix them with one of these atom, and eventually we’ll have water. No, they want to know what their final website is going to look like. When I changed the conversation and started talking about ‘Building Blocks’ (what we call our Drupal maintenance support plans paragraph types), site blocks (Drupal maintenance support plans‘s search block, branding block), display types (Drupal maintenance support plans‘s view modes such as teaser, search result), etc, they immediately understood. Then we started hearing things like, “Oh, so we can create a page by adding a number of different building blocks?” and “I see, so the search results page is made up of a group of pages using the ‘Search Result’ display type?”. And my response, “Yes!”. You see, we are using plain English to ease with understanding.

Another aspect of my approach that I really like is that _everything_ for each of my components is within the same directory. For example, if it’s a nested paragraph component such as an accordion (so we need a paragraph type called ‘Accordion’ and one called ‘Accordion Item’) each template and css and js and readme and json and yaml is all in the same folder. That means when I want to reuse one in another project, I don’t need to remember what sub-particles (atoms/molecules) are used to create the organism. It also means my CSS is scoped to that specific component and doesn’t bleed out of it, so making changes or adding new features is very easy, you just scope the new component’s CSS to it, so it won’t affect other previously-created components.

Now the top bar of my PatternLab that used to say Atoms | Molecules | Organisms, etc has tabs for:

Base
Colours
Spacing
Breakpoints

Basic Elements
Headings
Paragraphs
Lists

Site Blocks (Drupal maintenance support plans Blocks)
Search Block
Login Block
Branding Block

Building Blocks (Paragraph Types)
Accordion
Image with Text
Video

Content
Display Types (View Modes)
Teaser
Card
Search Result

Lists (Views)
Blog
Search Results

Content Types
Basic Page
Blog
Event

Page Sections (Regions)
Header
Footer
Sidebar

Sample Pages
Homepage
Blog Listing Page
Blog Node

After that, I have Backstop.js set up to regression test all of these, so each time I create a new component I can quickly run the visual regression tests and check that nothing has broken. Since all my CSS/JS is scoped to each individual component, it’s rare if something is.


Source: New feed

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

mark.ie: My Approach to PatternLab?

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.