-
Notifications
You must be signed in to change notification settings - Fork 142
[css-properties-and-values-api] define how typed custom properties influence @supports #118
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
Comments
Tab has a counterpoint: div { If --foo is registered as a length, then the second declaration will be discarded. @supports should behave the same. |
I agree, (a)supports should respect defined value types. |
One thing to be mindful of is that this would be the first |
Let's add a feature to |
Let's just put a note in properties & values and define the behavior in |
Would this be a little unintuitive? We would have " |
The Working Group just discussed
The full IRC log of that discussion |
eAdded, with an explanatory note. This is actually consistent with our parsing behavior; registered custom properties still accept all valid token streams at parse time, same as unregistered ones, but if you violate the registered grammar it automatically becomes invalid at computed-value time. Since @supports tests parsing behavior, it thus should accept anything for a registered custom property regardless of registered grammar. Note that:
My counterpoint was wrong. In that example, the declaration using a bad unit is still the one that'll get chosen at parse time, discarding the previous one. It'll just then become invalid at computed-value time, resetting to its registered initial value. Plus, as argued elsewhere, the use-case for @supports with a registered custom property is essentially nil. We need @supports because you're sending stylesheets to a panoply of browser versions, and you don't know what set of features will be valid on any individual one. But with registered custom properties, you know what the feature set is; it's whatever is supported by the library you're currently using. This doesn't change across browser versions; it's completely under the author's control. |
Thanks, that works for me. |
This is resolved now.
This is resolved now.
We should define how registered custom properties affect @supports. For example if registered with type
then@supports (--something: red)
would evaluate to false and@supports (--something: 2px)
true.The text was updated successfully, but these errors were encountered: