Skip to content

Instantly share code, notes, and snippets.

@csswizardry
Last active September 5, 2018 14:31
Show Gist options
  • Star 22 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save csswizardry/c849d22bdc160dc615df to your computer and use it in GitHub Desktop.
Save csswizardry/c849d22bdc160dc615df to your computer and use it in GitHub Desktop.
I frequently get asked about over-abstracted CSS, and ‘can CSS be too modular’, so I thought I’d publish this anonymised email I received, along with my reply.
@jacquesletesson
Copy link

To ease readability of the source and make a clear distinction between component related classes and utility classes , we could visually combine these classes with brackets like you do on http://csswizardry.com/

<div class="[ slider  slider--large slider--loading ] mb pt">

</div>

@jshjohnson
Copy link

"That is to say, having padding: 6px; appear in your CSS 50 times is no big deal. You will feel no performance impact. Gzip will crunch the bejeezus out of it."

Optimisation tools such as CSSO (https://github.com/css/csso) that can be incorporated into task runners avoid this problem!

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