-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[css-values-5] Should <whole-value>
functions be parsed before the declaration value range?
#10340
Comments
Unregistered custom properties just tokenize, except for a few things like
I don't see any reason to treat it specially, since unregistered custom properties accept almost everything? :root {
--color: first-supported(color(brand-new-color-space, ...), cyan);
}
.foo { color: var(--color) }
#bar something { color: var(--color) } |
I have not considered this option. So Even if |
Unregistered custom properties do not grammar-check at all besides the basic validity of substitution functions in their value. They shouldn't do anything special for Remember that one of the reasons we don't grammar-check custom properties is because they can be used to pass around information for non-CSS purposes; we do only the absolute bare minimum of checking (CSS-wide keywords, and other substitution functions) so people can avoid having to think abuot it as much as possible. That said, I think it's reasonable to clarify this in the spec. |
- a property with a CSS-wide keyword that is not the sole component value, eg. "initial identifier" for a hypothetical property defined with <ident>+ - a property or descriptor with an arbitrary substitution that is not allowed in the context, eg. "size: var(..., attr(...))", which is inappropriate (w3c/csswg-drafts#10337) - a custom property with a <whole-value> value that would be invalid for a standard property, eg. "--custom: not first-valid(whole-value)", which is inappropriate (w3c/csswg-drafts#10340)
The previous implementation prevented declaring: - a property with a CSS-wide keyword that is not the sole component value, eg. "initial identifier" for a property defined with <ident>+ - a property or descriptor with an arbitrary substitution that is not allowed in the context, eg. "size: var(..., attr(...))" (w3c/csswg-drafts#10337) - a custom property with a <whole-value> that is guaranteed to be invalid after substitution, eg. "--custom: not first-valid(whole-value)" (w3c/csswg-drafts#10340)
CSS-wide keyword parsing should kick in first because
--custom: initial
should result to--custom
being declared to its initial (guaranteed-invalid) value rather than the<ident-token>
forinitial
(the result from matching against its value definition).Arbitrary substitution parsing should then kick in before the value range because
--custom: var(1)
should be invalid. They should be parsed before<whole-value>
becausedisplay: var(--empty) first-valid(block)
should be valid (at parse time, at least).Should
--custom: first-valid(not, whole) value
be valid?The text was updated successfully, but these errors were encountered: