4 ms·
Do you have any resources or examples you recommend for this? My front-end knowledge is over a decade old. I would still be assigning all these colours individu
by kowlo 6y ago
Do you have any resources or examples you recommend for this? My front-end knowledge is over a decade old. I would still be assigning all these colours individually in CSS!
- 1f60c 6y agoSass Basics seems like a good place to start: https://sass-lang.com/guide https://sass-lang.com/guide
- petepete 6y agoI don't have anything to hand and I only use a tiny number of Sass's built-in features, but here's a super-quick demo of styling with variables and darken (https://sass-lang.com/documentation/modules/color#darken https://sass-lang.com/documentation/modules/color#darken). https://jsfiddle.net/peteryates/uqdnj4sa/10/ https://jsfiddle.net/peteryates/uqdnj4sa/10/ Note, darken and lighten aren't always favoured these days, it's good advice to learn scale (https://sass-lang.com/documentation/modules/color#scale https://sass-lang.com/documentation/modules/color#scale), but darken or lighten makes for an easier demo.
- Andrex 6y agoYou could start with native CSS variables. :) https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_c...
- dairylee 6y agoNot very easy to darken/lighten colours easily using CSS variables at the moment. Support will be coming in the future.
- schpaencoder 6y agoI find it quite easy. Just use the hsl() function.