Open miragecraft opened 4 weeks ago
There was an idea to use --
for that, see https://github.com/w3c/csswg-drafts/issues/6313#issuecomment-854844912
I prefer all-vars
personally as --
reads like a syntax error to me, plus it breaks from the tradition of CSS properties spelling out what they’re for.
At the end of the day I just want to have a way to reset all custom properties, if everyone prefers --
I have no objections.
If there's no compat against it, could use --all
to be more explicit.
As an author I want to be able to use --whatever
without fearing that it won't be forwards compatible because CSS will reserve it in the future.
Among the things starting with 2 hyphens, we only reserved --
, so I think we should go with that, if any.
Another approach is to introduce a keyword into the all
property to extend its coverage to custom properties, or to introduce an all-behavior
property and put the keyword there, similar to transition-behavior
, to allow later inclusion of properties excluded today or in the future.
Another approach is to introduce a keyword into the
all
property to extend its coverage to custom properties, or to introduce anall-behavior
property and put the keyword there, similar totransition-behavior
, to allow later inclusion of properties excluded today or in the future.
That approach forces you to use the same value for both regular properties and custom properties.
With a dedicated property, you are able to specify all:unset; all-vars:revert-layer
.
Note that all
is a shorthand (at least according to the spec, but Blink isn't compliant). I don't think this can be a shorthand because shorthands need to expand at parse time, but there is an infinite number of possible custom properties. So I wouldn't mix this with all
.
to allow later inclusion of properties excluded today or in the future
As long as all
is a shorthand this is not possible, because the value of transition-behavior
isn't known until computed value time, but we need to expand shorthands earlier in the cascade.
As third party CSS can cause custom property name collisions, I propose a companion property to the existing
all
property that would allow us to reset all custom properties.I'm tentatively naming it
all-vars
.