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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.