CSS Minification Incorrect, possible to disable minify but still Aggregate?
-
Hello. With CSS Optimization enabled, some styles are not being applied despite the rules coming through in the minified CSS. Checking into it, the styles within the minified CSS are within a media query block (max-width:479px) and when reducing the screen to 479 or less pixels, the styles are indeed applied. However, these styles in the original CSS files are not within a media query block, and with CSS Optimization disabled, the styles are applied all the time which is the intended behavior.
If I untick “Aggregate all linked CSS-files”, the minified styles are correct — they are not within a media query block. Where performance is particularly hurting though is the number of CSS files (about 39 in total), and having the CSS files aggregated to one file in particular helps on performance tests, more so than the minification.
Unfortunately the site has a lot of CSS. The minified/aggregated CSS file is 1.7 MBs uncompressed. I’m not sure if the incorrect minification is due to the overall size of the CSS, or if there’s a glitch with the minifier or if there are any syntax issues with the original CSS that is leading to the incorrect minification. With 39 CSS files, it’d take time to go through each of them looking for syntax issues, if there actually is a syntax issue, which might not be the case.
The best solution would be if the minification to a single CSS file worked correctly. The next best solution would be if Autoptimize had an option to still Aggregate the files without minifying them as that alone would help with performance… reducing 39 CSS files down to 1. It seems like this would not be a particularly involved option to add? Any suggestions are appreciated, many thanks.
Ben
- The topic ‘CSS Minification Incorrect, possible to disable minify but still Aggregate?’ is closed to new replies.