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

Regression in 3.2.0: when source maps are enabled, the minified content changes #534

Closed
hostep opened this issue Apr 19, 2015 · 5 comments
Closed
Assignees
Labels

Comments

@hostep
Copy link

hostep commented Apr 19, 2015

I noticed this happening with font-family, I didn't check if other properties are affected

Input:

@font-face {
  font-family: 'si';
}
.soc-icon {
  font-family: 'si' !important;
}

When you clean this without source maps enabled, you get this:
@font-face{font-family:si}.soc-icon{font-family:si!important}

When you clean this with source maps enabled, you get this:
@font-face{font-family:'si'!important}.soc-icon{font-family:'si'!important}/*# sourceMappingURL=blahblah.css.map */

Notice the first !important which shouldn't be there and also the quotes around the font-family

This didn't happen in 3.1.9

@jakubpawlowicz
Copy link
Collaborator

@hostep, thanks for giving it a try so quickly. It's interesting not a single test caught it - I'll find out why tomorrow morning.

@jakubpawlowicz jakubpawlowicz self-assigned this Apr 19, 2015
jakubpawlowicz added a commit that referenced this issue Apr 20, 2015
Flat blocks (`@font-face`) were omitted when adding optimization metadata,
thus an important attribute was incorrectly added.
@jakubpawlowicz
Copy link
Collaborator

@hostep the issue with !important is fixed in 3.2.1.

Getting rid of unwanted quotes is a bit more complicated as we do it at too late stage thus a refactoring is needed to support it properly - see #407.

@hostep
Copy link
Author

hostep commented Apr 20, 2015

Ok thanks for the quick fix, I'll try it out later today.

@gtbuchanan
Copy link

Thanks for such a quick fix! This caused one of our icon fonts to stop showing up in IE9 (guess it didn't like the important on a font-face src). Took me forever to figure out this was the issue though, lol.

@jakubpawlowicz
Copy link
Collaborator

Thank you all for testing! With each release clean-css gets better thanks to 2.5k+ tests we have now.

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