We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi. I have encountered an issue while using nested media queries with pseudo-elements. Look.
$ cat package.json { "type": "module", "scripts": { "build": "node main.js" }, "devDependencies": { "browserslist": "^4.23.2", "lightningcss": "^1.25.1" } }
$ cat main.js import browserslist from "browserslist" import {browserslistToTargets, bundle} from "lightningcss" function main() { const l = browserslist("> 0.25%") const t = browserslistToTargets(l) const r = bundle({ drafts: {customMedia: true}, filename: "main.css", minify: false, targets: t, }) console.log(r.code.toString()) } main()
$ cat main.css @custom-media --m (width >= 1px); .a::before, .a::after { display: block; } .a::before { @media (--m) { content: ""; } } .a::after { @media (--m) { content: ""; } } .b::before, .b::after { display: block; @media (--m) { content: ""; } }
$ pnpm build .a:before, .a:after { display: block; } @media (min-width: 1px) { .a:before { content: ""; } } @media (min-width: 1px) { .a:after { content: ""; } } .b:before, .b:after { display: block; } @media (min-width: 1px) { :is(.b:before, .b:after) { content: ""; } }
$ pnpm build .a:before, .a:after { display: block; } @media (min-width: 1px) { .a:before, .a:after { content: ""; } } .b:before, .b:after { display: block; } @media (min-width: 1px) { .b:before, .b:after { content: ""; } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi. I have encountered an issue while using nested media queries with pseudo-elements. Look.
Setup
Current
Expected
The text was updated successfully, but these errors were encountered: