Re: [csswg-drafts] [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)

Based on this [comment](https://github.com/w3c/csswg-drafts/issues/8717#issuecomment-1509246256), math functions are valid everywhere a `<number>`/`<percentage>`/dimension, is accepted. Spec authors should use the corresponding `<*-token>` variants if they should not be valid.

In practice, UAs do not accept them everywhere a `<number>`/`<percentage>`/dimension is accepted, like in [the prelude of a keyframe rule](https://drafts.csswg.org/css-animations-1/#typedef-keyframe-selector).

For arbitrary substitution values like `var()`, this same comment says they are only valid for property values. Unless otherwise explicitly specified, I guess, like in `@font-palette-values` declarations.

In practice, UAs accept `var()` in `@page` and margin rules, there are discussions to accept `env()` in the prelude of `@media`, I think `first-valid()` could be used in any declaration, etc.

---

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.

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


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

Received on Tuesday, 10 September 2024 12:11:04 UTC