How to create color shades using CSS variables similar to darken() of Sass?
The new Specification introduces “relative color syntax” where you can do the following :root { –color-primary: #f00; /* any format you want here */ –color-primary-darker: hsl(from var(–color-primary) h s calc(l – 5%)); –color-primary-darkest: hsl(from var(–color-primary) h s calc(l – 10%)); } The idea is to convert the main color to hsl format and using calc() … Read more