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:
From the code download that accompanies this...