Book Image

Mastering PostCSS for Web Design

By : Alex Libby
Book Image

Mastering PostCSS for Web Design

By: Alex Libby

Overview of this book

PostCSS is a tool that has quickly emerged as the future of existing preprocessors such as SASS and Less, mainly because of its power, speed, and ease of use. This comprehensive guide offers in-depth guidance on incorporating cutting-edge styles into your web page and at the same time maintaining the performance and maintainability of your code. The book will show how you can take advantage of PostCSS to simplify the entire process of stylesheet authoring. It covers various techniques to add dynamic and modern styling features to your web pages. As the book progresses, you will learn how to make CSS code more maintainable by taking advantage of the modular architecture of PostCSS. By the end of this book, you would have mastered the art of adding modern CSS effects to web pages by authoring high performing, maintainable stylesheets.
Table of Contents (21 chapters)
Mastering PostCSS for Web Design
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Extending PostCSS with plugins


A question, how many times have you worked with plugins that by themselves don't actually achieve anything?

I'll bet the answer won't be a high figure—and no, I'm not including those plugins that claim to perform an operation, yet don't seem to work for some reason! The power of PostCSS lies not in the core system, but the plugins that we use to manipulate our CSS style sheets.

At the time of writing, there are more than 200 plugins available for use within PostCSS—these range from extending PostCSS (such as postcss-nested or postcss-mixins), to manipulating colors (such as postcss-color-hcl or postcss-rgba-hex), to plugins that cater for future CSS syntax (such as adding @extend support).

Note

The full list is available at https://github.com/postcss/postcss/blob/master/docs/plugins.md, or via the searchable catalogue hosted at http://www.postcss.parts.

To date, we've used a fair number of plugins throughout our examples—we've configured them for use, but there...