Sass recently launched a major new feature
you might recognize from other languages:
a module system.
The new syntax will replace @import with
@use and @forward –
a big step forward for making Sass partials
(one of the language’s most used features)
more readable, performant, and safe.
This article goes into detail,
but you can also read our
“Sass Modules, a Primer” article
for the quick introduction.
Viewport units have been around for several years now,
with near-perfect support in the major browsers,
but I keep finding new and exciting ways to use them.
I thought it would be fun to review the basics,
and then round-up some of my favorite use-cases.
Preprocessor loops are useful for writing DRY CSS.
While everyone is talking about pattern libraries and modular design,
most of the focus has been on CSS selectors.
No matter what acronym drives your selectors
(BEM, OOCSS, SMACSS, ETC),
loops can help keep your patterns more readable and maintainable,
baking them directly into your code.
We’ll take a look at what loops can do,
and how to use them in the major CSS preprocessors:
Sass, Less, and Stylus.