An introduction to pattern libraries, how to use them, what they’re for, and a tool, Patternbot, that we can use to generate a pattern library.
Pattern libraries
A common approach to designing websites
Create a library to showcase all the pieces together
We’ll have lots of different HTML & CSS files
Buttons: buttons.html, buttons.css
buttons.html
buttons.css
Cards: link-card.html, image-card.html, cards.css
link-card.html
image-card.html
cards.css
etc.
Some CSS will be shared, but only the most basic stuff:
modules.css
grid.css
type.css
theme.css
The theme.css will contain the common fonts, colours & basic typography & CSS variables
Unless you’re working in the theme.css—do not target HTML elements
Absolutely everything will have a class on it—to avoid conflicts
The theme.css is the only place you’ll target <h1> or <dl>, etc.
<h1>
<dl>
We don’t want to—and shouldn’t have to—write all the CSS to make the library display website
It’s much better to use a tool to generate the page
We can then concentrate on making the patterns—not on making the layout
Jekyll Patternbot—Your pompous and persnickety patterning robot. A system for making pattern libraries, integrated with Jekyll for amazing static site generation. Jekyll Patternbot »