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

Variable !important is replaced with none when level 2 is enabled #1060

Closed
pawelkondraciuk opened this issue Jan 31, 2019 · 1 comment
Closed
Labels

Comments

@pawelkondraciuk
Copy link

Precheck

  • Do a quick search and make sure a bug has not yet been reported;
  • do a quick check if the bug still exists in the latest patch version;
  • finally, be nice and have fun!

Environment

  • clean-css version - 4.2.1:
  • node.js version - 8.11.3:
  • operating system: macOS 10.14.1

Configuration options

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

Input CSS

:root {
  --border-test: 1px solid red;
}
.u-test {
  border-left: var(--border-test) !important;
}

Actual output CSS

:root{--border-test:1px solid red}.u-test{border-left:none!important}

Expected output CSS

:root{--border-test:1px solid red}.u-test{border-left:var(--border-test)!important}

Notes

Without !important flag it compiles to

:root{--border-test:1px solid red}.u-test{border-left:var(--border-test)}
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

3 participants