-
Notifications
You must be signed in to change notification settings - Fork 837
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
[a11y] EUI does not respect user/browser default font sizes #7143
Comments
CCing in the folks who had opinions on this during our sync today: @1Copenut @kyrspl @mdefazio I'll bring this up at our next week's meetings as well for more discussion if we'd rather wait until then, but wanted to start this thread now for async thoughts in the meanwhile. One thing that I strongly think is worth discussing: big name tech companies like Google, GitHub, and Microsoft (see links in PR description) follow this same pattern of ignoring browser default font sizes. Is this an oversight or a deliberate decision? What do they know that we don't? Does a more consistent visual experience trump user customization in this case, especially since browser zooming already exists? To be clear, I don't necessarily agree with the above questions, but I want them to at least be discussed. |
I think I like this approach if i'm understanding the implications correctly.
We would still have a default for this token and a font-size would still be assigned to the html tag, right? So EUI behaves the same out-of-the-box with this change? It's just a matter of possible (poor) customization?
My gut reaction:
|
I prefer the second option
The new
Making our default Now, with all that said, there's a very non-zero risk to making this change. It'll be a manual QA effort and should have a long public comment period so there's no surprises when we make the cutover. |
Yes, that's correct. With our current
Just to clarify, |
Just realized I missed a couple of (really excellent) questions from Defazio:
I think the answer is broadly yes, but I also think the accessibility benefit of allowing users to tweak their default font size outweighs this concern.
At this point we've already made
Yes - @y1j2x34 had a perfectly valid one in #7124. Their use-case is that they're using EUI for a browser extension, not a webpage. Their app renders on any website on the internet, which could be setting any font-size on the root For that use case, there literally isn't an accessible solution that respects browser default font sizes (because if the random website on the internet isn't using relative font sizes, neither does the extension). The only workaround the extension would have to make their font sizing more accessible would be to allow users to customize the app's base font size - which again, we can add a note and recommendation in our docs, but we can't do more than that. |
This issue was discovered while implementing #7124, and when several EUI team members brought up recommending against
px
units as less accessible thanrem
andem
.Problem
By default, EUI sets a global pixel value
font-size
onhtml
:eui/src/global_styling/reset/global_styles.tsx
Line 42 in 3ab325b
(Note: This value is unaffected by / does not respect the new
defaultUnits
token implemented in #7133).What this means is that EUI does not respect user-set browser settings for default font sizes. Most browsers default this to 16px, but if a user wants a default font size of 32px (e.g. for vision issues), EUI will completely ignore that setting:
The above screenshot is of Firefox on MacOS, but this has also been reproduced and confirmed on Chrome as well.
Reproduction
For comparison, other websites that do respect custom user/browser font size:
And other websites that also do not respect user/browser font size:
Proposed solution
To be clear, EUI has not respected the browser default font size since its inception (i.e., well before the Emotion conversion). To "fix"/change this now would potentially be a major breaking change for consumers or an unexpected surprise for users. If we want to change the default font size we set on
html
to be more accessible going forward, we need to make this choice very deliberately, and communicate that clearly to our consumers as well.It might also be worth discussing the approach we want to take:
html
font size respect the newdefaultUnits
token, which means potentially allowing consumers to deliberately choose to make their applications less accessible (does this have valid use-cases?)html
font size always be relative (e.g. using%
instead) and ignoredefaultUnits
WCAG or Vendor Guidance (optional)
The text was updated successfully, but these errors were encountered: