Skip to content

[css-values-5] if() function style() styntax should allow for container-names #12273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mirisuzanne opened this issue Jun 4, 2025 · 4 comments

Comments

@mirisuzanne
Copy link
Contributor

Currently the syntax for if() allows style conditions with style() – but there is no place to specify an explicit container to query by name. This will also be an issue if querying container sizes by way of unit-comparisons (eg 100cqi > 30em) - though I think we agreed to make a functional unit syntax for that.

@Loirooriol
Copy link
Contributor

The functional container units were added in #7858 (comment)

@andruud
Copy link
Member

andruud commented Jun 5, 2025

(As discussed at CSS Day:)

The style() part within if() is actually not a container query; it queries the element itself.

Do we also need container (style) queries in if()?

@bigandy
Copy link

bigandy commented Jun 5, 2025

@andruud hell yeah we want container queries in if() I raised #12069 raising this.

@mirisuzanne
Copy link
Contributor Author

I think the ability to query specific containers will be useful, yes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants