- From: Guillaume via GitHub <noreply@w3.org>
- Date: Mon, 30 Mar 2026 12:53:44 +0000
- To: public-css-archive@w3.org
cdoublev has just created a new issue for https://github.com/w3c/csswg-drafts:
== [css-conditional-5][css-env-1] Evaluation of support of custom environment variables ==
This a follow-up to the recent addition (#13676) of `@supports env(<ident>) {}`.
I would like to clarify whether [`env()` for `@supports`](https://drafts.csswg.org/css-conditional-5/#typedef-supports-env-fn) 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](https://drafts.csswg.org/css-link-params-1/#css-link-parameter), which is intended for *the author*, if I am not mistaken. (I imagine other ways will be added later.)
But CSS Environment Variables [states](https://drafts.csswg.org/css-env-1/#css-environment-variable):
> 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.
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13744 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 30 March 2026 12:53:44 UTC