-
Notifications
You must be signed in to change notification settings - Fork 656
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] Specs that use CSS values outside of normal style rules should provide information on calc()/non-absolute length resolution in a uniform way #10853
Comments
So, should we replicate similar text in a bunch of places, or define it somewhere central and then reference it? |
Based on this comment, math functions are valid everywhere a In practice, UAs do not accept them everywhere a For arbitrary substitution values like In practice, UAs accept Fwiw, I think they should not be explicitly allowed if it is implicitly allowed/disallowed in a central place. This creates confusion, unless they are explicitly allowed where they should be, which might be error-prone. |
My thought was to have some default behavior for non-style rule cases, either disallowing relative length units entirely, or using some default values (though what default values you would use for the viewport for cases that might not have access to a viewport, like some of the HTML canvas color parsing functions, is unclear). (as I forgot to cc the relevant editors originally, doing that now, @tabatkins @fantasai). |
To make sure I had issues filed to track them, I filed a bunch of issues on the places I have found so far (at least within CSS): #10876 - [css-fonts] How should relative-length values be interpreted when used in as well as this one on whether calc() should be allowed in the #10879 - [css-animation] Is calc() allowed to be used for the production in the I probably missed some, so let me know if there are any additional ones to track. |
I think they always resolve based on the computed values of the root element but it might be useful to clarify it, especially for nested |
There is an ever growing number of places that use CSS values outside of normal style rules. There are the ones within the umbrella of CSS, such as various at-rules like
@font-face
,@font-palette-values
, etc, and in media query syntax. And there are the ones outside that umbrella, like HTML Canvas, which uses CSS values in a number places such as for declaring colors, fonts and filters, or the Geometry module's rules for parsing a matrix from a string.Some of these define exactly what to do with calc() and/or non-absolute length values. For instance, CSS Fonts has this to say for @font-palette-values:
Great stuff. But finding similar rules, even in the same spec for
@font-face
or@font-feature-values
is not something I was able to do.I would be very helpful if there was some uniformity across specs on how this information was defined.
The text was updated successfully, but these errors were encountered: