Stylesheets enqueued with media query (min/max width) lose that restriction
-
I was trying to track down why simply combining CSS was making styles that I know should be mobile-only for a plugin (The Events Calendar) appear on the full-width, desktop screen width.
I’ve nailed it down to the mobile stylesheet from that plugin being enqueued with a $media parameter of “only screen and (max-width: 768px)”
WooCommerce does it too.
What seems to be happening in the minifier is that the contents of those stylesheets are being dumped into the same file, promoting them to apply to “all” instead of the intended screen size.
If it doesn’t already exist (because I could have missed an option somewhere, that’s very possible), is there any way the minifier can have some logic built in that will preserve those media attributes in the combined file by wrapping them in
@media
queries?
- The topic ‘Stylesheets enqueued with media query (min/max width) lose that restriction’ is closed to new replies.