O'Reilly logo

Mastering PostCSS for Web Design by Alex Libby

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Parsing CSS

At the heart of writing any custom syntax is the ability to parse content—it doesn't matter whether this is CSS, JavaScript, or something else; we clearly need to understand what we're working with, before we can make changes! At a basic level, these are the steps we must take to transform our CSS when working with PostCSS:

Parsing CSS

We begin with our source CSS (which comes with or without a source map), which we parse only once, but then put through any number of specified plugins (the example shows two, but we can easily use more). We then convert the output to a string using a stringifier; at this point, we can view the contents on screen or ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required