4 ms·
It would be quite nice to see some more "killer" uses of this new feature that aren't just "we removed some duplication and... saved less than 1% of our loc".
by gampleman 1y ago
It would be quite nice to see some more "killer" uses of this new feature that aren't just "we removed some duplication and... saved less than 1% of our loc".
And maybe there are some really compelling ones... I think the only really useful one I see here is `--abs`, which really should just be built-in.
- semolino 1y agoabs() exists with cross-browser support: https://developer.mozilla.org/en-US/docs/Web/CSS/abs https://developer.mozilla.org/en-US/docs/Web/CSS/abs There are also other non-custom math functions like round() which can be very useful.
- deleted 1y ago[deleted]
- hombre_fatal 1y agoIt's not for DRYing/golfing code. The main use case of functions is that you can parameterize code. This lets you parameterize stylesheets, like set a base font size and primary color, and then derive your whole theme from it, from spacing to secondary border colors to how buttons look when they're hovered.
- gampleman 1y agoYou can do that with custom properties already. AFAICT functions don't introduce any new abilities on that front (apart from the aforementioned DRY-ing).