You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-conditional-5][css-env-1] Evaluation of support of custom environment variables #13744
This a follow-up to the recent addition (#13676) of @supports env(<ident>) {}.
I would like to clarify whether env() for @supports can only evaluate a "standard" environment variable to true, or also a custom environment variable, provided that it has been registered somehow.
It seems that the only way to define a non UA-defined environment variable at the moment, is to use CSS link parameters, which is intended for the author, if I am not mistaken. (I imagine other ways will be added later.)
Environment variables can be defined by the user agent, or by the user. (In the latter case, the names are <custom-property-name>s, and start with -- per standard for custom identifiers.)
So perhaps this may be more appropriate?
Standard environment variables are defined by the user agent. Custom environment variables can also be defined by the author or the user.
If it can evaluate a custom environment variable, I think CSS Conditional needs to define that a CSS processor is considered to support an environment variable if the <ident> is an ASCII case-insensitive match for a UA-defined environment variable, or an ASCII case-sensitive for a custom environment variable.
Alternatively, since "UA-defined environment variables are officially defined and must be supported", they could be represented with <standard-environment-variable> (or a similar production), defined in CSS Environment Variables, and used in env() for @supports.
A CSS processor could then be considered as supporting an environment variable if the specified identifier matches one of these keywords, or if it is an ASCII case-sensitive match for a registered custom environment variable.
Activity