-
Notifications
You must be signed in to change notification settings - Fork 719
[mediaqueries] Account for minimum font size in relative length media queries #5858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I agree with you. As long as browsers are not implementing the minimum font-size via some property (applied in the UA stylesheet), then there shouldn't be any technical reason why doing what you suggest should be unfeasible. |
Minimum font-size does not affect em/rem lengths in computed values on elements. Blink aligned with Firefox for M79 fixing 308862. The reason for fixing it was that a minimum font-size would break a lot of real-world layouts. We discovered that when there was a bug which accidentally wrote a minimum font-size of 6px from the settings UI and we got many reports about it. The typical failing sites would set the font-size on the html element to a size lower than the minimum font-size expecting rem units for other elements to not be affected by the minimum font-size. So, I don't think the statement about relative units in the first comment is accurate. At least not for Chrome or Firefox. The width and height of this box is 100px regardless of minimum font-size:
|
With typical browser defaults, this box would be 100px wide.
|
The CSS Working Group just discussed
The full IRC log of that discussion |
I like that wording! Thanks all! |
When a browser has a minimum font-size that is larger than the default font-size, the initial font-size used in media queries is relative to the smaller value. For a site that has been coded to scale with relative lengths, this can cause many layout issues as breakpoints no longer align with what has effectively become relative size of the content. Relative units in declarations are affected by minimum font-size, but media queries are not affected.
In the context of this following statement, I think the initial value of the font size should be defined as the greater of the user-specified sizes—either default or minimum font-size.
"Relative length units in media queries are based on the initial value, which means that units are never based on results of declarations."
https://www.w3.org/TR/mediaqueries-5/#units
The text was updated successfully, but these errors were encountered: