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

Can't use clean-css compatibility option. #112

Closed
reedling78 opened this issue Jul 23, 2014 · 2 comments
Closed

Can't use clean-css compatibility option. #112

reedling78 opened this issue Jul 23, 2014 · 2 comments

Comments

@reedling78
Copy link

My minified css files are breaking in IE8. I noticed that you are using clean-css for magnification so I started playing with the clean-css options. I found most of them to work fine through grunt except for "compatibility".

cssmin: {
options: {
compatibility: true
},
minify: {...}
}

Error
TypeError: Cannot call method 'test' of undefined

OS Windows 8

@sindresorhus
Copy link
Member

Should be opened on the clean-css issue tracker.

@ademarre
Copy link

ademarre commented Aug 1, 2014

@reedling78 I had a similar experience with IE8, but ultimately decided it was not a bug.

First, compatibility: true doesn't work. It doesn't take a boolean but rather 'ie7' or 'ie8'.

cssmin: {
  options: {
    compatibility: 'ie7'
  },
  ...
}

Additionally, I was using grunt-pixrem to add a px fallback to rem units for IE8. It turns out the clean-css "advanced optimizations" undo the fallback. It would work to disable the advanced optimizations with the option noAdvanced: true, but it's better to simply run the pixrem task after cssmin. pixrem preserves the minification; it does not restructure the file.

(Ditto for #109)

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

3 participants