Re: [csswg-drafts] Should common @when and if() functions be the same? (#12903)

[`@import`](https://drafts.csswg.org/css-cascade-5/#typedef-import-conditions) also has its own `supports()`.

|   Context | `supports()` argument
| --------- | ------------
| `@import` | `<declaration> \| <supports-condition>`
|   `@when` | `<declaration>`
|   `if()`  | `<ident> : <declaration-value> \| <supports-condition>`

|   Context | `media()` argument
| --------- | ---------
|   `@when` | `<mf-plain> \| <mf-boolean> \| <mf-range>`
|   `if()`  | `<media-feature> \| <media-condition>`

An argument "in parens" accepts almost any value, thanks to `<general-enclosed>`. But `<declaration>`, `<media-feature>`, `<mf-*>`, do not. However, `<declaration>` must be parsed as if it was specified in parens in `@import`, so `@import 'foo.css' supports(garbabe);` is still valid.

I thought these differences were editorial.

-- 
GitHub Notification of comment by cdoublev
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12903#issuecomment-3375022186 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 7 October 2025 03:22:53 UTC