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

Chapter 5. Managing Colors, Images, and Fonts

A website isn't a great website without some form of color, imagery, or fonts—a mix of these will add interest, express content more clearly where words might be insufficient, and generally help maintain visitor engagement.

Users of existing preprocessors will of course be familiar with libraries such as the Compass authoring framework for SASS from http://www.compass-style.org; what if we could produce similar effects, but much faster, and without the need for dependencies? No problem, with PostCSS, we can pick and choose which plugins are needed for our site, and begin to build up a processor that suits our needs. We will cover a number of topics throughout this chapter, which will include:

  • An overview of plugins available to handle colors, images, and fonts

  • Creating image sprites using existing preprocessors

  • Adding SVG support using existing preprocessors

  • Transitioning to using PostCSS plugins

  • Manipulating colors and color palettes using PostCSS...