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

Summary


Over the years, developers have had to frequently write code that duplicates all or part of a selector—a perfect example is styling lists or navigation items. It's a real pain to have to write so much extra code; instead we can use nesting principles to help remove some of this code. We've covered a number of techniques around nesting in PostCSS throughout this chapter, so let's take a moment to review what we've learned.

We kicked off with an introduction to nesting, to help bring us up to speed, before launching into using the postcss-nesting plugin to create nested styles within PostCSS. We then moved on to creating our nesting demo. We began with preparing a plain vanilla CSS version, before taking a look at converting to existing processors such as SASS.

Moving on, we then took a look at converting our code using the postcss-nesting plugin, before exploring some of the pitfalls that are associated with nesting, and some of the tips and tricks we can use to reduce CSS specificity...