Re: [csswg-drafts] [css-values-5] allow container queries in `if()` if-test (#12069)

I am not sure we want/can have them in the same way we can have `style()` — the `style()` is evaluated for the element itself, so if we were to replicate it for container queries, we'd have to compare the dimension of the element itself, and that could lead to many circularity issues. And doing this check for the _container_ will mean inconsistency, which can be confusing.

That said, in https://github.com/w3c/csswg-drafts/issues/11104 it was resolved to add simple `calc()`-like comparisons, where we could do something like `if((100cqw > 600px): …)` — use container query length units and compare them with other values, which should mostly replicate what container size queries can achieve.

Right now we would be missing an ability to get values from named containers, but this should be covered by https://github.com/w3c/csswg-drafts/issues/7858

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


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

Received on Friday, 15 August 2025 10:53:42 UTC