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

**Regarding accessibility:**

Best practice for CSS authors is, and has always been, to define font sizes relative to the user's preferred font size. There are now three ways to do this, which all work equally well in the browsers that allow users to set a preferred font size:

- use only percentage sizes; this, however, makes font sizes dependent on the nesting structure of your DOM: 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.

- 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`

- use `rem` units, and never change the font-size on the root element; this is what I currently recommend, now that `rem` has fairly good browser support.

Sadly, far too many web pages *do not* follow this best practice. So browsers offer a second option: zooming the definition of a pixel. The major downside to this is that it zooms everything on the page, creating blurry images and sometimes strange layouts.  It's wonderful that browsers provide this option, but it doesn't replace the benefits of having customizable default font sizes.

**Regarding this issue in particular:**

If the only user agents that support customizable font sizes (i.e., changing the default font size as measured in `px`) also adjust the keywords to match, that should be in the spec.  User agents aren't *required* to support a user-customizable default font size, but if they do, the user setting must also affect the keywords.

In other words, the following settings on the root element should always be equivalent, and the same as having no font-size declaration at all on the root element:

```css
:root {
  font-size: 100%;
  font-size: 1rem;
  font-size: medium;
  font-size: initial;
}
```

(and that all the other keywords should adjust up or down relative to `medium`).

In this way, accessibility guides can continue to recommend that authors always use `medium` text body text, confident that it will adjust to user preferences, regardless of whether the user adjusts the default font size or the overall browser zoom level.

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

Received on Wednesday, 25 April 2018 19:28:56 UTC