Vitalik Buterin
@vitalik.eth
CSS on my blog reduced from 5875 lines to 233 lines. https://vitalik.eth.limo/css/main.css Today is a great day for simplification. All software (incl law) should do this more.
24 replies
50 recasts
356 reactions
Darryl Yeo 🛠️
@darrylyeo
Love to see it! You can do even better though – use `light-dark()` to define both light and dark variants of each CSS color variable at once, then have your JavaScript toggle set `color-scheme` to `dark` or `light` on the `<html>` element. https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/light-dark https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
1 reply
0 recast
9 reactions
Darryl Yeo 🛠️
@darrylyeo
Also, nested CSS rules are natively supported now in all major browsers, so any long repetitive parent IDs or class names (`.markdown-body`, `#color-mode-switch`, etc) can be pared down to one instance each. https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_nesting/Using_CSS_nesting
1 reply
0 recast
4 reactions