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

Minify - omit contents of invalid @media queries #904

Open
pbowyer opened this issue Jan 29, 2025 · 0 comments
Open

Minify - omit contents of invalid @media queries #904

pbowyer opened this issue Jan 29, 2025 · 0 comments

Comments

@pbowyer
Copy link

pbowyer commented Jan 29, 2025

I see CSS in the wild that has media queries that can never evaluate to true, e.g.:

@media screen and (min-width: 1020px) and (max-width: 739px) {
  .foo {color: red}
}

@media screen and (min-width: 740px) and (max-width: 1019px) and (min-width: 1020px) and (max-width: 1135px) {
  .bar {color:green}
}

When minifying the CSS it would be good if lightningcss omitted these media queries and their contents entirely, resulting in a smaller bundle size.

Demo in playground

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

1 participant