2 ms·
> Hard to see the use-cases for sass in 2024 Possibly mixins, loops, and variables, which, unlike CSS variables, can be used in media queries.
by azangru 4y ago
> Hard to see the use-cases for sass in 2024
Possibly mixins, loops, and variables, which, unlike CSS variables, can be used in media queries.
- ramesh31 4y ago>Possibly mixins, loops, and variables, which, unlike CSS variables, can be used in media queries. Please god no. CSS is intended to be completely declarative. Loops and conditional logic were the very worst ideas SASS ever had.
- patates 4y agoPeople want freedom (as seen by the down-votes comment above seems to have gathered) and I do remember the old times when I was very excited for the creativity SASS allowed me. Then in-between then and now, I did a lot of consulting work, and now I'm strongly feeling that the more DRY you try to make CSS, the more you end up writing, and unmaintainable CSS at that. Random example: https://github.com/primefaces/primeflex/blob/master/_sass/lib/src/_grid.scss#L75 https://github.com/primefaces/primeflex/blob/master/_sass/li... SASS is too powerful for its own good. TL;DR: I wholeheartedly agree with the above comment.
- clairity 4y agoyes, mixins. even just static sets of declarations would be a great start, e.g., wanting to apply the same set of base rules to both an entity and various classes without error-prone repetition (which you typically separate to have control over cascading and specificity). css variables in media queries would be helpful too, but mixins to me is the next big step after :has() (oh so useful, come on firefox!) and this nested css syntax. unfortunately, it may be years for us to see it in browsers. there's no consensus yet on mixin syntax or where in the css lifecycle it would be implemented (there are potentially serious performance implications apparently).