Post #2375691
2023-01-15 20:18 UTC
@ngdangtu@tilde.zone Fallback is absolutely useful:
- https://css-tricks.com/using-custom-property-stacks-to-tame-the-cascade/
- https://www.smashingmagazine.com/2019/07/css-custom-properties-cascade/
Sure, there could have been various ways to define a syntax for that - and I wasn't on the WG when this was discussed - but i expect
function(--dashed-ident, fallback)
is more clear, and invents less new syntax than
--dashed-ident-as-function(fallback)
Which is good, because now there is a proposal for more powerful custom functions using:
--dashed-ident(custom, args)
https://github.com/w3c/csswg-drafts/issues/7490
Replies (1)
-
@ngdangtu@tilde.zone 2023-01-16 02:24
@mia@front-end.social when I need fallback, I usually define one in the same rule. It later will be overwrite by inline css. It really trouble when you need to do calc in css. Lot of brackets were used and I rarely dare to look back the fomular once it works...