Skip to content

CSS - Don't strip spacing before !important #37

namanyayg opened this Issue Dec 29, 2012 · 9 comments

5 participants


If !important is used on css declarations, the whitespace before it is stripped, rendering the whole important and the declaration obsolete.

tml commented Jul 3, 2013

This was merged into 2.4.8

@tml tml closed this Jul 3, 2013
@WickyNilliams WickyNilliams referenced this issue in jakubpawlowicz/clean-css Sep 5, 2013

Incorrectly removes space before `!important` #143


@tml @namanyayg Could you provide any examples where stripping a space before '!important' leads to a broken styling?

We got the similar request in but without a test case it's not possible to verify if you made a mistake or if there is a very specific case where the space has to be there.

According to our tests it is OK to get rid of it. What's more such code has been used in production for couple years now without any issues.


Can we get some background or data on this, or revert the change? Without any more information, this seems like a needless regression. We've also been using 2.4.7 for a while now in production without issue.

blowsie commented Jun 6, 2014

I can confirm that this space is important in some browsers / mail clients.

Outlook 2007 is definitely effected by this.

blowsie commented Jun 6, 2014

Also, although its not in the spec that a space should be present, all of their examples have it.


So you punish all other browsers because of Outlook 2007?

blowsie commented Jun 9, 2014

Yes. And punish? Hardly. The rule shouldn't really be used anyway. But its required to fix bad implementations of browers etc. eg. Outlook 2007 etc.


If you consider Outlook 2007 a browser then good for you. 👍

blowsie commented Jun 10, 2014

@GoalSmashers Really? I even stated bad implementations of browsers.

Outlook makes up for a huge percentage of the mail client market share.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.