DEV Community

Discussion on: Why doesn't CSS move faster (like JavaScript)?

Collapse
 
nektro profile image
Meghan (she/her) • Edited

There's one key feature that I see JavaScript have that makes this possible. JavaScript has the very unique feature (hailing from being dynamic and loosely typed) in that developers can make polyfills. Between extending prototypes, writing new functions, backwards-compatible transpilation, and more, it makes a project like Babel possible.

CSS on the other hand is very not extensible. Or at least yet. CSS Houdini brings some promise, but this is brand new and not actually possible yet in any browser. Due to this lack of extensibility, pre-processors have had very little wiggle room in the land of the amount of features they can add. We got nesting, we static variables, we got mixins, but still no parent selector.

Collapse
 
panta82 profile image
panta82

This is the correct answer.

Collapse
 
michaeljota profile image
Michael De Abreu

I forgot about Houdini, but I had read about how complex it is to develop a CSS polyfill compared to a JS polyfill.

I think this is one of the most important features about JS moving fast. Right now you can use transpilers, for sure, but for the things that are not already implemented, then you have a good polyfill waiting for you. (Web Components, to say something). I hope with Houdini API developers that do CSS polyfill have a better work, and can implement new features faster.