Skip to content
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

CSS container query unit support #1266

Open
bernesto opened this issue Dec 18, 2023 · 3 comments
Open

CSS container query unit support #1266

bernesto opened this issue Dec 18, 2023 · 3 comments

Comments

@bernesto
Copy link
Contributor

Can we add support for CSS container queries.

Currently throws warnings for container query length units:

cqw: 1% of a query container's width
cqh: 1% of a query container's height
cqi: 1% of a query container's inline size
cqb: 1% of a query container's block size
cqmin: The smaller value of either cqi or cqb
cqmax: The larger value of either cqi or cqb

(https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_container_queries#container_query_length_units)

@jakubpawlowicz
Copy link
Collaborator

We can. Those need to go into validator.js here - https://github.com/clean-css/clean-css/blob/master/lib/optimizer/validator.js#L338

@bernesto
Copy link
Contributor Author

bernesto commented Dec 19, 2023

I submitted a pull request.

This may be more complex: I also notice that it strips out classes wrapped in @container queries such as this:

@container sidebar (min-width: 700px) {
  .card {
    font-size: 2em;
  }
}`

@jakubpawlowicz
Copy link
Collaborator

Thanks @bernesto! For @container, please check if you use an older version of clean-css, as it seems to work OK with clean-css 5.3.2, see here: https://clean-css.github.io/

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

No branches or pull requests

2 participants