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

Using our own animation plugin


Throughout the course of this chapter, we've used the small number of animation-based plugins that are available for PostCSS, and demonstrated some of the effects possible. This is all well and good, but one can't help but feel that this is a little limiting—and can we do something about it?

Absolutely, the beauty of PostCSS is that if there is a need for a plugin, then we can create something to fill that gap. A perfect example of this is the lack of CSS-based animation plugins available; at present, all we have is postcss-animations, which inserts animations from the Animate.css style sheet created by Dan Eden. I've used this as a basis for a new plugin—we'll use the same framework, but convert it to use the Magic set of animations, available from http://www.minimamente.com/example/magic_animations/.

We will cover the construction of plugins in more detail in Chapter 8, Creating PostCSS Plugins. Let's make a start:

  1. From the code download that accompanies this...