Rebranding ComputerMinds – Part 4: Pattern Lab

We didn’t see this project solely as a chance to rebrand and rebuild for ourselves, it was also an opportunity to try something new and expand our collective knowledge with the potential for using with clients in the future. We had been discussing using Pattern Lab for Front End development for some time and this was the perfect opportunity to try it out.
Patten Lab allows the creation of component-driven user interfaces using atomic design principles. This means we can create modular patterns all packaged up nicely that can be assembled together to build a site. Plus we can use dynamic data to display the patterns in a live style guide which makes viewing each component quick and easy. And nobody is viewing out of date designs or code – an issue we had on a recent project. With Pattern Lab, we would have a central place to view all of the actual components that will be used on the live site.
The guys over at Drupal Update made implementing a Pattern Lab with Drupal maintenance support plans super easy, by creating Emulsify. Serving as a Drupal maintenance support plans 8 starter kit theme, Emulsify allows you to build and manage components without using Drupal maintenance support plans‘s template names but by using custom template names that make sense to everyone, instead. When you’re ready, you can easily connect them up to Drupal maintenance support plans.
Building the frontend in this way allows it to be built separately from the backend development. It’s possible to create the whole of the front end before even touching Drupal maintenance support plans. If needs be, it also allows developers to work on the frontend and backend at the same time without stepping on each other’s toes.
Because we were to be using Emulsify, we quickly set up a Drupal maintenance support plans codebase (using composer) which allowed us to then jump in and clone the Emulsify theme and begin working on the Front End. Once we had the theme, it was real easy to get the sass and javascript compiling, set up a local server (to view the style guide) and watch for changes, with one command:

npm startAs well as compiling, this command also provides a url for the local server. Open it up in a browser and you can see your live style guide!
Now for the actual components. These are filed in the theme, inside:

components/_patterns/As we’re working with Atomic Principles, the smallest components are filed first building up to the biggest. The beauty of pattern lab is nesting – it’s possible to include patterns inside each other to make larger components. Although it’s not necessary to use Atomic Design naming conventions when organising patterns, it does make sense. These levels are:
Atoms
Molecules
Organisms
Templates
Pages
Atoms are the basic elements of the site like HTML tags and buttons. Molecules combine these Atoms to create larger components like a card and then Organisms can combine Molecules to create more complex page components and so on…
Numerics are added to ensure they are listed in the correct order and also a Base folder is added to house variables, breakpoints, layouts and global sass mixins. So, this is how our file structure looks inside that _patterns folder:

– _patterns/
– 00-base
– 01-atoms
– 02-molecules
– 03-organisms
– 04-templates
– 05-pagesWithin each of the Atomic Design folders is a set of components. Each component comprises of a Twig file, a Sass file and in some cases a Javascript file. These files contain code specific to that component. Having all the code for each component organised this way makes it really easy and fast to edit components, and also add new ones.
Having just the code that makes the component isn’t enough for us to view it in our style guide. In addition to the files that make up the component, we can also include files to give the component context. A Markdown file allows us to give the component a title and description, which are used in the navigation and style guide. To each component folder we can also add a YML file which holds filler content solely for use for the style guide. We basically just take each variable name from the twig file and provide some content for each.
So, a typical component file structure might look like this:

– card
– _card.scss
– card.md
– card.yml
– card.jsOnce we had a full understanding of the structure and had added our colour palette and set up our grid and breakpoints it was a case of working through the designs to determine what the components were and of which size. Then starting with Atoms and working up we could build each component. We’ll look at the actual development in the next article in the series.

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

Rebranding ComputerMinds – Part 4: Pattern Lab

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.