4 ms·
> but we still run it through sass because enough customers are using Android or older versions of Chrome that don't support the nesting. How does sass help in
by DEADMINCE 2y ago
> but we still run it through sass because enough customers are using Android or older versions of Chrome that don't support the nesting.
How does sass help in this instance?
- jweir 2y agosass expands the nesting ie .foo { .bar { color: red; } } becomes .foo .bar { color: red; } The first case modern browsers can handle, but versions of Chrome upto some in early 2023 still can't – and that includes a lot of Android installs as I experienced. Once those browser versions roll off we will be able to remove sass altogether.
- DEADMINCE 2y agoThanks, I appreciate the answer example!
- alwillis 2y agoSass variables and CSS Custom Properties (a.k.a. CSS variables) are pretty different from each other [1]. If you want to use CSS Nesting and be backwards compatible with older browsers, the PostCSS plugin postcss-preset-env handles that and lots of other new CSS features that older browsers don't support [2]. [1]: https://sass-lang.com/blog/sass-and-native-nesting/ https://sass-lang.com/blog/sass-and-native-nesting/ [2]: https://preset-env.cssdb.org https://preset-env.cssdb.org
- DEADMINCE 2y agoThanks!