Why I Don鈥檛 Use CSS Preprocessors
Published on Dec聽14, 2016 (updated Jun聽6, 2021), filed under development, css. (Share this post, e.g. on Mastodon or on聽Bluesky.)
This is one of 180 articles that you can also read in an ebook: On Web Development聽II.
Though late I wish to follow Roger as I couldn鈥檛 agree more with him: I don鈥檛 use CSS preprocessors, either (never so in my personal projects), because CSS preprocessors are like a solution in need of a problem to me, too.
My reasons almost perfectly match Roger鈥檚:
I don鈥檛 feel the problems CSS preprocessors intend to solve are serious enough to warrant the cost, either, and to me the solution is worse than the problems as well.
I want absolute control of my CSS and work directly on it, too, and likewise see exactly what will be sent to the browser before it鈥檚 getting minified and compressed. (In this list I don鈥檛 care too much that parts of the concerns may be addressed through better tools in the future.)
I don鈥檛 want to learn and depend on a non-standard syntax to wrap my CSS in, either, neither would I want to learn several syntaxes, and again neither would I want my teams to.
I want my source CSS to be deployable at all times, too, and if any build processes fail I equally like to be able to deploy the source CSS as an emergency solution.
I don鈥檛 want to have to wait for compilation before seeing the results of CSS changes, either.
In addition to these points, I could always mirror preprocessor functionality through languages like PHP, just like Bert Bos had brought forth as a main argument against CSS constants.
The only exception to me, and there I disagree with Roger, is that we don鈥檛 only need but can actually have pretty DRY CSS without preprocessors. Not repeating ourselves should be first nature to us, a part of our craft, and as we can鈥檛 yet automate DRYing up CSS it鈥檚 on us to keep our style sheets efficient and maintainable.
As for CSS post-processors, I don鈥檛 use them, either, then, again at least not in my personal projects; yet that鈥檚 a different story, and I close with another hat tip to Roger. Listen to what he says聽馃槉
About Me
I鈥檓 Jens (long: Jens Oliver Meiert), and I鈥檓 an engineering lead, guerrilla philosopher, and indie publisher. I鈥檝e worked as a technical lead and engineering manager for companies you use every day (like Google) and companies you鈥檝e never heard of, I鈥檓 an occasional contributor to web standards (like HTML, CSS, WCAG), and I write and review books for O鈥橰eilly and Frontend Dogma.
I love trying things, not only in web development and engineering management, but also with respect to politics and philosophy. Here on meiert.com I talk about some of my experiences and perspectives. (Please share feedback: Interpret charitably, but do be critical.)
