Writing CSS by hand is often long and repetitive. Andrey Sitnik, a Russian developer from Saint Petersburg, had the idea of creating a tool capable of simplifying and improving the way cascading styles are edited: PostCSS was born.
What is PostCSS?
A complete tool that lets you transform your CSS code using JavaScript plugins. Once the software is installed, you can download a number of plugins offering different features. The idea is to build a CSS tool that suits you. Among the plugins, you will find:
- Autoprefixer: this extension parses the syntax of CSS files and adds vendor prefixes to CSS rules. It is currently the most popular PostCSS plugin — it is even used by Google and Twitter.
- cssnext: using tomorrow’s CSS today? That is what this plugin offers: it lets you write CSS with a syntax compatible with any browser. No more elements that display in Firefox but not in Chrome!
- Stylelint: this plugin helps you avoid mistakes in your CSS by giving you advice in the console. It supports the latest CSS syntax as well as the SCSS language.
The software and all of its plugins can be downloaded from the GitHub platform.
Note for the English version: cssnext has been deprecated for several years and was superseded by postcss-preset-env; the plugin list should be refreshed before publication (and “Twitter” is now X).
PostCSS: popular software that appeals to the web giants
The software was launched on GitHub in 2013. In 2014 it passed the 1.4 million downloads mark over a year; in 2015 the 3.8 million mark was passed. The software enjoyed such success that its usage more than doubled in the space of a year.
Among PostCSS’s millions of users are several global leaders of the digital world, such as Facebook, GitHub, Google, WordPress, Wikipedia, JetBrains and Taobao.com.
Notes for the English version: the download figures date from 2014–2015 and are dramatically out of date — PostCSS now records tens of millions of npm downloads every week. The French version also describes Wikipedia as “the little French one of the bunch”, which is inaccurate (Wikipedia is run by the US-based Wikimedia Foundation); the aside was dropped here and should be removed from the French article too.
What about you — are you a PostCSS user? Which are your favourite plugins? Tell us all about it on social media.