-
Notifications
You must be signed in to change notification settings - Fork 7
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
Generating pixel fallbacks for rem units works fine when not loading the minified css version #1
Comments
Better yet: Turn it into this from line 119 in gulp.js:
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Generating pixel fallbacks for rem units works fine when I don’t load the minified css version, but when I add:
add_filter( ‘stylesheet_uri’, ‘genesis_sample_stylesheet_uri’, 10, 2 );
/**
Loads minified version of style.css.
@param string $stylesheet_uri Original stylesheet URI.
@param string $stylesheet_dir_uri Stylesheet directory.
@return string (Maybe modified) stylesheet URI.
*/
function genesis_sample_stylesheet_uri( $stylesheet_uri, $stylesheet_dir_uri ) {
return trailingslashit( $stylesheet_dir_uri ) . ‘style.min.css’;
}
It does it all but generating pixel fallbacks for rem units, at least. I don’t know if it also merges the media queries or what else. I only kow that when I leave the filter out, it will load the non-minified version and does all the things it says it does in your repo description. What could be going wrong there?
My guess is that all doubles get merged by clean-css. Found a thread that looks alike: clean-css/clean-css#233
Logics:
The clean-css command in gulp.js is merging similar rules into one when minified. So, when using the minified css the pxtorem will be lost.
I found out changing it to:
// Combine similar rules.
.pipe(
cleancss({
}
})
)
// This will prevent it from merging, leaving the pxtorem intact amoung other rules. Thus making the minified css somewhat bigger in filesize, but at least leaving the pixel fallbacks for non-modern browsers intact.
The text was updated successfully, but these errors were encountered: