Chapter 9 Preprocessors

Authoring CSS can be tedious. There’s a set of repeated colors and fonts to manage and remember. We need to keep track of vendor prefixes. And sometimes we want to do tasks, such as nesting or grouping rules, that are beyond the native capabilities of CSS.

This is where preprocessors come in handy. Preprocessors add syntax capabilities and features that CSS lacks: mixins make it a breeze to manage vendor prefixes; built-in functions save us from unit and color conversions; and the ability to extend a selector lets us consolidate style rules.

As the name suggests, preprocessors take a special syntax and compile it to CSS. They are tools for writing CSS, although some tools also handle minification and concatenation. ...

Get CSS Master now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.