3 ms·
After looking at the spec, I'm wondering does this really save anything for the client, vs. doing this in a CSS preprocessor? Instead of spending the time compi
by userbinator 13y ago
After looking at the spec, I'm wondering does this really save anything for the client, vs. doing this in a CSS preprocessor? Instead of spending the time compiling once and then having clients interpret declarations, every single user who visits the site will have their browser perform the same computation, every time they visit a page that uses these. It's also another source of significant complexity to the browser.
- pornel 13y agoCSS Variables are a misnomer. They're custom properties that obey cascade and inheritance. CSS preprocessors can do only lexically scoped substitutions. With CSS "variables" you can have values inherited within DOM's scope.
- ufo 13y agoCan you give an example of a situation where you would rather have cascading variables than lexical scope?
- pornel 13y ago• JS libraries implementing polyfills for new CSS properties or their own CSS-like behaviors (e.g. `--masonry-display: jagged-grid`) • themes (`--theme-color` that can be inherited and overridden just like `color` would)
- pjmlp 13y agoLess dependency on third party tooling. Many companies are weary of extra dependencies on their developer tooling.