Re: [csswg-drafts] [css-fonts] font-size: 'medium' value is the user's preferred font size

> Best practice for CSS authors is, and has always been, to define font sizes relative to the user's preferred font size.

That is 1 recommended practice. Many accessibility-oriented, accessibility-advocacy websites also recommend to avoid size smaller than the user's preferred font size.

> There are now three ways to do this

I think there are 4 ways. 
[em unit is one way](https://www.w3.org/2003/07/30-font-size#goodcss). 
Not setting a size for the text in the `body` is another recommended way by many authors (John Allsop, Dan Tobias, Chris Beal, Nick Theodorakis, Stephen Poley, Jim Wilkinson and I know there are others). That is what I do, by the way, in my own website.
`rem unit`: the only specificity of rem unit in comparison to em unit is that it avoids the compound effect of cascade: it is a stable and more predictable (easier to manage) value for CSS coders.

> a `<small>` inside an `<aside>` may get a different font size than a `<small>` in the main text, if the` <aside>` has a different font size from the main text.

The only way to be sure of this is to examine the user agent style sheet for `<aside>` and `<small>`. 
In Chrome 26.0.1410.63 and in Firefox 20, the rule in the user agent style sheet was:
`small, sub, sup {font-size: smaller;} /* Appendix D gives small, sub, sup {font-size: .83em} */`
and back then, `font-size: smaller` meant 2 distinct and different scaling factor for those 2 browsers.

In an ideal web-world, manufacturers of browsers would use the exact same user agent style sheet and web authors would not bother, would not wonder and would not struggle or hesitate about any of such issues and questions.

> use the keyword font sizes; the downside is that the relative difference between keywords can vary between browsers, so this is best only for resetting paragraph text to medium

That is possible (I have not checked this) but it is unlikely (otherwise this is not optimal, not interoperable) as it would be a reason to complaint and to demand cross-browser compatibility. I know that `smaller` and `larger` keywords meant in 2012 something different for Chrome, Firefox and Opera (Presto engine). 
`smaller` keyword meant
- a scaling factor of 1.5 for Firefox 10
- a scaling factor of 1.2 for Chrome 17
- a scaling factor of 1.25 for Opera 11.6
[font-size-118 : 'font-size: smaller'](https://lists.w3.org/Archives/Public/public-css-testsuite/2012Feb/0011.html)
I do not know about today...



-- 
GitHub Notification of comment by TalbotG
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2430#issuecomment-384440872 using your GitHub account

Received on Wednesday, 25 April 2018 21:31:25 UTC