A common type of feedback heard from authors on new CSS features is that they won’t use it because said feature does not have cross-browser support. This feedback is heard for all sorts of features, including those that can be used as a Progressive Enhancement. Within their organization there are often still expectations that websites need to look exactly the same in every browser. As a result, the adoption of new CSS features – PE-capable or not – is blocked until the feature is Baseline Widely available. Assuming an average time-to-interop of ±1.5 years, this means a CSS feature is only ready for adoption after 4 years.
To aid in the adoption of new CSS features, polyfills can be created. The polyfill for container queries for example has proven its worth. However, this polyfill – like any other CSS polyfill – is not perfect and comes with limitations because polyfilling CSS features comes with a lot of challenges and pitfalls. Above that, ±65% of the code is dedicated to purely parsing the CSS file and extracting the necessary information (property values and container at-rules) from it.
CSS Parser Extensions aims to remove these limitations and to ease this information gathering by allowing authors to extend the CSS Parser with new syntaxes, properties, keywords, etc. for it to support. By tapping directly into the CSS parser, CSS polyfills become easier to author, have a reduced size & performance footprint, and become more robust.