Skip to content

Instantly share code, notes, and snippets.

Last active Mar 5, 2021
What would you like to do?

We try to follow the methodology. The CSS for all component-like-things lives in the blocks directory. Blocks could either be BEM CSS components or web components. Here's a web component:

You can see how it's used here:

We use an Eleventy transform to feed the HTML for every page to PurgeCSS. Our PurgeCSS config looks at the raw html, and also our JS files, to figure out which classes to include in the page.

In dev mode we just compile one big stylesheet which includes every style used across the site. In prod mode we tell eleventy to run the transform and replace the dev stylesheet with inline styles:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment