CSS has been growing a lot of “super powers” lately, that used to require a pre-processor. Custom properties (variables), nesting, calc
, and color-mix
used to be things we’d reach for a preprocessor for, but can now be done 100% in pure CSS. And generally, the CSS based versions are better than their old preprocessor counterparts. calc
can mix units, so you can easily do things like calc(100% - 1rem)
to subtract a rem from 100% of the parent container. Can’t do that in Sass. Custom properties can be set by Javascript, or by media queries, and follow CSS scoping rules. Thats how I handle light/dark mode on my site.
3 points
Programming
!programming@beehaw.org
All things programming and coding related. Subcommunity of Technology.
This community’s icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.
Community stats
239
Monthly active users
246
Posts
1.6K
Comments