About CSS Post Processor

CSS Post Processor started in the mid-2010s, when CSS had no variables, no nesting and no way to compute a value. Sass and LESS solved that at build time. Many real sites, though, were built without a build pipeline: CMS themes, server-rendered pages, client sites edited by hand. Those sites needed the same power in a plain stylesheet.

The idea#

Instead of compiling ahead of time, compile in the browser. That one decision gave the library something build-time tools could never have: access to the live page. Very early on, a stylesheet could ask how wide the window was, how tall an element was, or how many slides a slider had. The $[index] variable that gives every slide its own image from one line of CSS dates from that time, and it is still something native CSS can't do.

Version 3#

By 2026, native CSS had caught up on variables, nesting and parent selection with :has(). Version 3 refocuses the library on what CSS still can't express:

  • :seen and :in-view, for reveal-on-scroll and visibility without JavaScript
  • :stuck, for sticky elements that are actually pinned
  • :overflowing, for truncated text and overflowing boxes
  • :contains() and numeric attribute comparisons, for styling based on content
  • A rewritten nesting engine, accurate $[index] in any markup, and a long list of fixes

Every new selector compiles to an ordinary attribute selector, so it works with the platform, including inside :has(), rather than around it.

In production since 2016#

The library has powered production websites for businesses, investment firms and schools for a decade. Version 3 was checked against more than fifty of those real stylesheets before release, and its browser behaviour is covered by an automated test suite.

The author#

CSS Post Processor is written and maintained by Alex Bobrov, a web developer who has built and run production websites and web platforms for clients since the early days of the library. Questions, bug reports and feature ideas are welcome on the contact page.

License#

CSS Post Processor is free and open source under the MIT License. Use it in personal, commercial and closed-source projects.