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

[Bug] : merge rules bug when use @supports #974

Closed
edokeh opened this issue Dec 21, 2020 · 1 comment
Closed

[Bug] : merge rules bug when use @supports #974

edokeh opened this issue Dec 21, 2020 · 1 comment
Labels
Milestone

Comments

@edokeh
Copy link

edokeh commented Dec 21, 2020

Describe the bug

cssnano not working correctly when use @supports

To Reproduce

origin css

@media  only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2),  only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 2) {
  @supports (padding-bottom: constant(safe-area-inset-bottom)) {
    .test {
      padding-bottom: calc(2 * constant(safe-area-inset-bottom));
    }
  }
}
@media  only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3),  only screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3),  only screen and (device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3),  only screen and (device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3) {
  @supports (padding-bottom: constant(safe-area-inset-bottom)) {
    .test {
      padding-bottom: calc(3 * constant(safe-area-inset-bottom));
    }
  }
}

Wrong output with cssnano

@media only screen and (device-width:375px) and (device-height:812px) and (-webkit-device-pixel-ratio:2),only screen and (device-width:414px) and (device-height:896px) and (-webkit-device-pixel-ratio:2){@supports (padding-bottom:constant(safe-area-inset-bottom)){.test{padding-bottom:calc(2*constant(safe-area-inset-bottom));padding-bottom:calc(3*constant(safe-area-inset-bottom))}}}
@ludofischer ludofischer added this to the 5.0.0 milestone Mar 19, 2021
@ludofischer
Copy link
Collaborator

Fixed in 5.0.0-rc.2

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

No branches or pull requests

2 participants