You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 );
/**
}
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({
level: {
1: {
all: false, // set all values to `false`
tidySelectors: true // turns on optimizing selectors
}
}
})
)
// 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:
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: