writing a postcss plugin https://github.com/postcss/postcss/blob/master/docs/writing-a-plugin.md Tutorial: http://webdesign.tutsplus.com/tutorials/postcss-deep-dive-create-your-own-plugin--cms-24605