CSS files with media queries are not excluded during CSS combination #3206
Labels
effort: [S]
1-2 days of estimated development time
module: file optimization
priority: medium
Issues which are important, but no one will go out of business.
type: bug
Indicates an unexpected problem or unintended behavior
Milestone
Before submitting an issue please check that you’ve completed the following steps:
Describe the bug
Currently, when combining CSS files we check for media queries here:
wp-rocket/inc/Engine/Optimization/Minify/CSS/AbstractCSSOptimization.php
Line 124 in 443f2e1
We do not exclude
link
elements containing media queries like:max-width
min-width
For example, the following file will be combined:
When that happens, we do not wrap the file's content around the media query, which would be the ideal solution.
Instead, we add it directly to the combined file.
The rules contained there may be applied to elements regardless of what the original media query dictated.
To Reproduce
Steps to reproduce the behavior:
max-width
. In that, change, e.g. the color ofh1
.Expected behavior
Files containing such media queries should be either automatically excluded or combined while wrapped in the original media query.
Additional context
Related ticket: https://secure.helpscout.net/conversation/1305858288/201378?folderId=2135277
Backlog Grooming (for WP Media dev team use only)
The text was updated successfully, but these errors were encountered: