Conversation
|
Lots of issues in this approach, "magic" numbers in em, two mobile-esque layouts to keep in mind, inconsistent looks depending on if you zoomed with text size, or zoom. I don't think we should advocate going halfway, you could just set a font size in PX on body and prevent the awkward label zooming when text size is zoomed. |
1 similar comment
|
Lots of issues in this approach, "magic" numbers in em, two mobile-esque layouts to keep in mind, inconsistent looks depending on if you zoomed with text size, or zoom. I don't think we should advocate going halfway, you could just set a font size in PX on body and prevent the awkward label zooming when text size is zoomed. |
|
Well, I think Responsive Design isn't about making sure everything looks "pixel-perfect" it is more about accounting the many variables of the web. If a user sheet increases the font-size the layout should respond to that, not break. I'm not advocating anything with this PR though. Just pointing at that as is, the labels get blown up because they aren't set declaratively with px. If we are going to stick with px we should consider setting that on the html or body to prevent that from happening. |
|
@tholex thought you might be interested in WCAG 2.1 1.4.11 which adds a new success criteria for sites to remain accessible without horizontal scrolling when scaled to 400%. 2.1 is still a DRAFT but, as it extends 2.0, it is safe to assume this does not mean only supporting "browser zooming" or default font sizes in browsers but also includes supporting standard user agent sheets and browser plugins which override CSS styles with something like: html { /* in a user sheet or a11y plugin */
font-size:400% !important;
}This success criteria can only be met when using relative units to size type. This is because WCAG 2.0 1.4.4 states users must be able to scale using the user agent, not just "browser zoom" which, by the way, is an action users have to initially perform on each web site they visit. This means media queries are also best to use relative units, and not pixels, as layout needs to scale without horizontal scroll. Yes modern browsers "zoom pixels" even though this was not the intent. So many developers misused the units that vendors had to make a breaking change and go against the intent of the CSS spec. And it actually made things worst because there is now no way to declaratively set font sizes anymore. In other words, think about text as illustration or texture, you can't say with absolute certainty "I want this type to be exactly 20px regardless of zoom level" which was the original intent of the specification. We've lost art direction capabilities by forcing modern browsers to reinterpret units. Further more not all browsers default Pixels make it easier for developers to think in pixels when authoring the web. Relative units make it easier for people, particular those with accessibility needs, to use and access the web. Looking forward, do we want to teach in accordance with Web Content Accessibility Guidelines? Do we want to teach students to make things easier on themselves, or their users? And if they have to decide between the two, which is the responsible choice as a (world wide) web professional?
I'm not trying to get Thinkful to take a stance one way or another on this. I do wonder if we should expose students one way or another to considerations and differences between the two approaches. Since this is such a endlessly debated issue (outside of the WCAG/a11y community at least) I was thinking we could add a Resources section that links to a couple articles that are for relative units and the same number that are against and use it as an example to tell students there are multiple opinions on practices, and as they progress throughout their journey they'll be solidifying their own. Note: WCAG 2.1 1.4.11 builds on WCAG 2.0 1.4.4 which requires a 200% zoom level for success criteria. See Also |
|
Your bolded statement contradicts your links & ignores the VAST majority of user agents (FF/ Chrome /Safari /IE10+), which all support zooming content outside of Browser Zoom is a feature of the user agent. The W3 detailed explainer of As is pointed out here – w3c/wcag21#77 (comment) – browser zoom is a much more reliable way to let the user scale the UI.
I DO think the amount of effort you're putting into this writeup is saying "we should strongly favor em/rem", even if you state otherwise. While there are some user agents that would be slightly better served by em/rem I'm more interested in teaching our students general design principles and improving their work across extreme viewport sizes, not a unit war... The WCAG defer to the user agent guidelines to define scaling... https://www.w3.org/TR/WAI-USERAGENT/guidelines.html#tech-configure-text-scale and this is what it states in 4.1: Sufficient techniquesThe user agent may satisfy provision one of this checkpoint through a number of mechanisms, including zoom, magnification, and allowing the user to configure a reference size for rendered text (e.g., render text at 36 points unless otherwise specified). For example, for CSS2 [CSS2] user agents, the medium value of the font-size property corresponds to a reference size. |
|
@tholex I had a chance to discuss this with WCAG authors at CSUN 2017 and confirmed that the success criteria requires more than just the browser zoom. Browser zoom is an action that has to be performed every time you visit a new site. As I learned from low vision users at CSUN 2017, this is a tedious process which is why user agent sheets, which have been part of web standards since CSS 1, are part of the success criteria under the "user agent" umbrella.
No it doesn't. Deque University is a leading source on these research topics. Please see: |
|
Two things about that link in particular show that it is an outdated view. That issue is about
Basically this page is saying "this used to be an issue." Now, I understand that browser zoom is not supported everywhere, but it's looking like the de-facto way to fix this going forward. All the modern browsers support zooming px values. This statement is not necessarily true:
E.g. chrome has no problem setting a default zoom on new pages... and remembers the user setting across domains as you probably know. |
Deque University and WCAG spoke to this at CSUN17 last month. They say relative units 👍 declarative units 👎 even in 2017 and onward.
Certainly that is convenient. User sheets can span across separate browsers and allow significantly more control over how they consume content on the web. This isn't about taking my word for it. Perhaps we'd benefit from speaking to a daily low vision user about this topic. I could arrange that if you'd like. |
|
I'm glad you bring up the Chrome settings. There is also a setting to change the font size. This setting will not be respected on type set in
Notice the labels are the only thing that scale when I change my browser preference. This is because they default to relative units, like every browser does and always will. (For the most part, with the exception of browser chrome, browser defaults for type are relative.) So can we at least agree on this? If you are going to set some type in It would be ridiculous to set all type in pixels and override every browser default. Which brings us back to sticking with relative units and going with, not against the grain, of browser default and AG. Of course there is an exception here. If you don't want the type to scale, This is an example of a user story that fails with font-size set in
|
|
JP, you've argued with me over and over about these two settings for a year and a half, of course I know the font-size setting... I don't mind the label/p explicit px, I think that any reasonable styleguide would set
Not what you mean by this... there are maybe only a dozen browser defaults regarding font sizes, and reset.css already resets them to 1em/100%. Setting them all to px / rem is less than 40 lines of CSS. I agree that consistency in supporting AND not supporting the font-size setting is important for people that use it, since it's probably hard to change that on a per-page basis. On the whole, I'd be very happy to talk with a low-vision desktop user, I find it highly unlikely that they would use a non-default font-size setting all over the web. Either they use zoom or some other method (OS zoom) to comfortably browse small content. Approving #5 and closing this. |
Sounds like a lot of code just to stop the user agent from doing what it was designed to do – give the user granular control over how they access the web.
Again, I recently attended the largest accessibility conference in the world, with over 5,000 attendees, and spoke to several low vision users about this 🤦♂️
Are you speaking on their behalf or is this an assumption of yours? I spoke with Rob Dodson of the Chrome team about this. He said:
Note: When Rob refers to OS settings that is still considered the user agent So hopefully they can provide some analytics. I think if you reach out to the community you'll find that users expect user agent font size settings to be respected. That's historically why those settings exists and why browsers default to relative units for content. |
|
I mentioned perhaps we should instruct students to read a few opposing articles on units. This one makes some excellent points:
Responsive Design isn't just about viewport width. It is also about responding to the user agent settings such as font size as well.
|
|
I reached out to the working group for clarification and was directed to this explanation of success criteria for 1.4.4. Hoping this clears things up for us.
Browser zoom is effectively a screen magnifier (although it only magnifies the viewport).
Declarative units still interfere with the support for resizing text regardless of the fact that modern browsers scale px when zooming now. Germany has the most strict accessibility laws I'm aware of. I've confirmed with an accessibility expert there that relative units should be used to satisfy 1.4.4. Regarding @tholex assumption:
Horizontal scrolling and panning (think mobile) is not a comfortable browsing or reading experience. Just try it yourself or reference this study. See Also |


This is just an example, that demonstrates a pattern of using both
emandpxunits to make for a more relative and responsive layout. It is not necessarily meant to be merged.Modern browsers support page zooming with pixel units but that isn't the only way a web page can be zoomed. Increasing the
font-sizeusing relative units such asemis a universal way to make a page more legible. Aside from browser zoom, this can be done by web components, browser plugins, or user sheets with the following CSS:The Issue
If
pxunits are used they will not scale along with relativefont-sizeunit of parent elements. In other words, they won't abide to the cascading nature of CSS. This can cause text to flow outside the container and even be hidden.Screencast (GIF)
The solution
Use relative units in areas the layout should scale. In some cases, use a combination of
pxandem. For example:This ensures that the component width scales with the type size while maintaining a minimum of our 400px desired width at 100% zoom.
Use
pxunits in areas you do not want the layout to scale. In this example,pxunits are used for the padding of the text inputs.Screencast (GIF)
To test yourself change the
font-sizeon the<HTML>element.