3 ms·
Writing actual CSS is the waste of time. SASS variables, mixins, and the "&" operator are pretty much indespensable.
by seumars 6y ago
Writing actual CSS is the waste of time. SASS variables, mixins, and the "&" operator are pretty much indespensable.
- runarberg 6y agoVanilla CSS has custom properties[1] (which are more powerful then SASS variables) and there is a proposal for the `&` nested selector[2] which you can get with PostCSS[3]. All you are missing are mixins, but there is a PostCSS plugin for that[4]. [1]: https://developer.mozilla.org/en-US/docs/Web/CSS/--* https://developer.mozilla.org/en-US/docs/Web/CSS/--* [2]: https://drafts.csswg.org/css-nesting-1/ https://drafts.csswg.org/css-nesting-1/ [3]: https://postcss.org/ https://postcss.org/ [4]: https://github.com/postcss/postcss-mixins https://github.com/postcss/postcss-mixins
- desert_boi 6y agoWho's to say you can't use Sass variables _and_ CSS variables? My current shop is moving to switch our sass color function `color.get()` to either dump hardcoded hex or a css variable usage based on a param. It currently just does hex.
- runarberg 6y agoWell, it was a response to the parents claim that “[w]riting actual CSS is the waste of time”. You might be happy to learn that CSS color module 4[1] will add `lab()` and `lch()` color definitions and CSS color module 5[2] will add the `color-adjust` function as well as other goodies. 1: https://www.w3.org/TR/css-color-4/ https://www.w3.org/TR/css-color-4/ 1: https://www.w3.org/TR/css-color-5/ https://www.w3.org/TR/css-color-5/