[csswg-drafts] [css-values-5] Disallow mix/random/tree-counting functions in some contexts (#10982)

cdoublev has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-values-5] Disallow mix/random/tree-counting functions in some contexts ==
Based on comments in #10879, any value defined in CSS Values and Units should be valid in any context other than a property value, unless otherwise specified.

[mix](https://drafts.csswg.org/css-values-5/#mixing), [random](https://drafts.csswg.org/css-values-5/#randomness), [tree couting](https://drafts.csswg.org/css-values-5/#tree-counting) functions, need an element, but are not explicitly disallowed in other contexts.

I would say they should be invalid in media queries and any descriptor value, and valid in the prelude of keyframe and `@container` rules. (It seems easier to find use cases in the prelude of keyframe rules.)

Perhaps defining the concept of *element-dependent (substitution) value* could help clarifying this: such value would be invalid in all contexts except those "associated" to an element, or that do not need to resolve its value (feature queries). `var()`, `attr()`, `toggle()`, `<whole-value>`, would be element-dependent subsitution values.

I do not know if any of these substitution functions should/can be valid in the HTML `srcset` attribute (to replace `<length>`), but invalid in the `media` attribute. I guess none is currently accepted, not even math functions.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10982 using your GitHub account


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

Received on Tuesday, 1 October 2024 14:21:14 UTC