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

"mergeNonAdjacentRules" not works in some cases #1244

Open
GoodDayForSurf opened this issue Jan 20, 2023 · 0 comments
Open

"mergeNonAdjacentRules" not works in some cases #1244

GoodDayForSurf opened this issue Jan 20, 2023 · 0 comments

Comments

@GoodDayForSurf
Copy link

GoodDayForSurf commented Jan 20, 2023

Environment

  • clean-css version: 5.3.2
  • node.js version: v18.12.1
  • operating system: Win10

Configuration options

var CleanCSS = require('clean-css');
new CleanCSS({"level": {2: { mergeNonAdjacentRules: true } } })

Input CSS

.selector .title {
  border: 0;
}
.wrapper .container {
  padding: 0;
}
.other{
   border-radius: 1px;
}
.selector .title {
  padding: 1px;
}

Actual output CSS

.selector .title {
  border: 0;
}
.wrapper .container {
  padding: 0;
}
.other{
  border-radius: 1px;
}
.selector .title {
  padding: 1px;
}

Expected output CSS

.wrapper .container {
  padding: 0;
}
.other{
  border-radius: 1px;
}
.selector .title {
  border: 0;
  padding: 1px;
}

If you replace border-radius with any other property, the merge will work as expected.

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