3 ms·
> if you only target browsers that support the custom properties spec That "sidenote" is exactly why vanilla CSS has a "Kinda" for theming. Taking a look at ca
by mxstbr 10y ago
> if you only target browsers that support the custom properties spec
That "sidenote" is exactly why vanilla CSS has a "Kinda" for theming. Taking a look at caniuse[0], only 66.39% of browsers have support for custom properties – not exactly production ready.
That being said, once custom properties are well supported they're an amazing solution for theming! Take a look at this talk Glen (the co-creator of CSS modules and now styled-components) gave at JSConf BP for some hints towards this future: https://www.youtube.com/watch?v=XR6eM_5pAb0 https://www.youtube.com/watch?v=XR6eM_5pAb0
[0]: http://caniuse.com/#feat=css-variables http://caniuse.com/#feat=css-variables
- pluma 10y agoIMO PostCSS is a workable solution until that number gets closer to 100%. It just requires the aforementioned post-processing step per theme to "render" the stylesheet with the correct variables: https://github.com/postcss/postcss-custom-properties https://github.com/postcss/postcss-custom-properties