Consider switch to CSS range syntax for media queries in Optimization Detective #1696
Labels
Needs Discussion
Anything that needs a discussion/agreement
[Plugin] Optimization Detective
Issues for the Optimization Detective plugin
[Type] Enhancement
A suggestion for improvement of an existing feature
Feature Description
The
od_generate_media_query()
helper function is used to generate media queries like the following:The
max-width
numbers are coming fromod_get_breakpoint_max_widths()
with themin-width
numbers being one greater than the previous max-width.However, could there be an issue where windows are sized sub-pixel dimensions, so that a window is for example 601.5px wide? In this case, neither of these rules would apply and it would be better to use the new CSS range syntax (Can I use?). See writeup. The above CSS could be rewritten instead as:
This is more concise and it addresses any sub-pixel concerns, although it seems this is only an issue in Firefox according to What to do about sub-pixel media-queries?
The text was updated successfully, but these errors were encountered: