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

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

Closed
namanyayg opened this issue Dec 29, 2012 · 9 comments
Closed

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

namanyayg opened this issue Dec 29, 2012 · 9 comments

Comments

@namanyayg
Copy link

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

tml added a commit that referenced this issue Apr 11, 2013
Fix issue #37 (removing spaces on !important)
@tml
Copy link
Contributor

tml commented Jul 3, 2013

This was merged into 2.4.8

@GoalSmashers
Copy link

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

We got the similar request in https://github.com/GoalSmashers/clean-css 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.

@nanodeath
Copy link

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
Copy link

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
Copy link

blowsie commented Jun 6, 2014

Also, although its not in the spec that a space should be present, all of their examples have it.
http://www.w3.org/TR/CSS2/cascade.html#important-rules

@GoalSmashers
Copy link

So you punish all other browsers because of Outlook 2007?

@blowsie
Copy link

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.

@GoalSmashers
Copy link

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

@blowsie
Copy link

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.

jgneff added a commit to jgneff/www-volano-legacy that referenced this issue Sep 22, 2020
The change to the screen.css file is due to the following issue:

  CSS - Don't strip spacing before !important
  yui/yuicompressor#37
jgneff added a commit to jgneff/www-volano-report that referenced this issue Sep 22, 2020
The change to the screen.css file is due to the following issue:

  CSS - Don't strip spacing before !important
  yui/yuicompressor#37
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

5 participants