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

removeUnusedAtRules option drops @font-face if the usage has !important #989

alfaproject opened this issue Dec 6, 2017 · 1 comment · Fixed by dalton-0x0/cohort3#38 or grechut/watchdog#41 · May be fixed by kosiakMD/progressive_optimistic_ui#1, JuliusMorkunas/liker#16 or m0rphtail/Teleport#4


Copy link

alfaproject commented Dec 6, 2017


  • clean-css version: 4.1.9
  • node.js version: 8.9.1
  • operating system: macOS 10.13.1

Configuration options

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

Input CSS

@font-face {
  font-family: f;

i {
  font-family: f !important;

Actual output CSS


Expected output CSS

@alfaproject alfaproject changed the title removeUnusedAtRules option drops @font-face if the usage has !important removeUnusedAtRules option drops @font-face if the usage has !important Dec 6, 2017
@jakubpawlowicz jakubpawlowicz added this to the 4.1.10 milestone Mar 2, 2018
jakubpawlowicz added a commit that referenced this issue Mar 5, 2018
When a value has `!important` in it then it should be stripped bare
before matching to the list of at-rules.
Copy link

It's fixed in 4.1.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment