<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ian Savchenko on Medium]]></title>
        <description><![CDATA[Stories by Ian Savchenko on Medium]]></description>
        <link>https://medium.com/@ian.savchenko?source=rss-bbb605c69230------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*I5Q8pQCWuniazkI40uJFqw.jpeg</url>
            <title>Stories by Ian Savchenko on Medium</title>
            <link>https://medium.com/@ian.savchenko?source=rss-bbb605c69230------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 01:49:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ian.savchenko/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Designing for Accessibility: How Text Resizing Works in Different Web Browsers]]></title>
            <link>https://medium.com/paypal-tech/designing-for-accessibility-how-text-resizing-works-in-different-web-browsers-bed9e424e071?source=rss-bbb605c69230------2</link>
            <guid isPermaLink="false">https://medium.com/p/bed9e424e071</guid>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[ux]]></category>
            <dc:creator><![CDATA[Ian Savchenko]]></dc:creator>
            <pubDate>Tue, 25 Jan 2022 15:03:06 GMT</pubDate>
            <atom:updated>2022-01-29T10:17:34.838Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b9eVy0R7quaUX73-v78zUQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@alex_andrews?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Alexander Andrews</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Have you heard that 33% of mobile users have text size adjustment enabled on their phones? According to <a href="https://accessibility.q42.nl/">this excellent research by Q42</a> conducted among more than 1 million Dutch users, many mobile users require text resizing in order to properly read on their mobile devices. While this large survey was conducted specifically in the Netherlands, the data are similar to what is observed across other countries around the world. Therefore, ensuring quality text resizing is vital for approximately one third of your users.</p><h3>Introduction</h3><p>Hi, I’m Ian, a Web Developer at <a href="https://www.zettle.com/gb">Zettle</a>, PayPal’s point-of-sale solution.</p><p>In one of the <a href="https://medium.com/paypal-tech/text-resizing-flexible-components-for-improved-accessibility-e5bbf538fba6">recent stories</a> on PayPal Technology Blog my colleagues, James and Kiersten, covered why it is important for modern applications to support text resizing. They also discussed text resizing challenges and solutions in PayPal’s iOS and Android apps, so make sure to check it out.</p><p>When it comes to Web, another great reference is the <a href="https://www.w3.org/WAI/WCAG21/Understanding/resize-text.html">success criterion for text resizing</a> from the Web Content Accessibility Guidelines (WCAG). According to this criterion, content scaling is primarily a user agent responsibility. On the other hand, web content should not prevent user agents from scaling effectively. Thus, web developers need to understand what content scaling techniques are implemented in the browsers.</p><p>In our team, we are working on web apps that equally support desktop and mobile clients. Recently, we’ve found several text resizing issues, and as it often happens in web development, solving them for one browser didn’t mean they would be solved for all.</p><p>This story covers what our team learned about web browser content resizing techniques and how exactly text resizing settings affect elements on a webpage.</p><h3>Research setup</h3><p>When text resizing is applied to elements on a webpage, the effect can be different depending on <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/length">length units</a> used.</p><p><strong>Absolute length units</strong> (<em>cm</em>, <em>in,</em> <em>px, etc.</em>) are considered to always be the same size and it is possible to use them interchangeably. In the research, I will showcase <em>px (aka </em><a href="https://developer.mozilla.org/en-US/docs/Glossary/CSS_pixel"><em>CSS pixel</em></a><em>), </em>since it is the most common choice for screen-rendered content.</p><p><strong>Relative length units</strong> (<em>rem</em>, <em>em</em>, <em>vw</em>, <em>vh</em>, etc.) are relative to some other values such as the font size of the parent element or viewport width. In our case, it makes sense to showcase <em>rem </em>units as they seem to be affected by text resizing settings in the first place (unless a developer overrides <em>font-size</em> of the root element directly). Also, we’ll look at <em>em</em> for certain cases and a more exotic example of <em>vmax </em>unit (larger value of either viewport width or height).</p><p>To be able to see what kind of impact text resizing has, I’ve created a small webpage that showcases absolute and relative length units applied both to text elements and non-text elements (an image of a ⭐️ in our case).</p><p>Although, we will primarily be looking at upscaling of the text, it’s good to remember that downscaling is also possible.</p><h3>iOS | Safari: Intro to Page Zoom</h3><p>Let’s start with the Safari browser for iOS on iPhone SE 2020. As mentioned above, a special webpage was created to be able to track the effect text resizing has. It showcases three options:</p><p>1) An image and a text element, dimensions of which are defined in <strong><em>px</em></strong><em>.</em></p><p>2) An image and a text element, dimensions of which are defined in <strong><em>rem</em></strong>.</p><p>3) An image and a text element, dimensions of which are defined in <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/length"><strong><em>vmax</em></strong></a>.</p><p>With the help of <a href="https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver">ResizeObserver API</a>, we can track their size in pixels as it changes. Also, at the top right corner, we can see the size of the viewport using the same approach.</p><p>The only content resizing setting in Safari for iOS is page zoom. We can control its level with the help of the <em>Aa </em>button in the address bar. This is how the page looks initially and with 200% zoom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*ecp2MqsgYamiNTkLTZZ7wA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*U9-z0xKpoHwOuHPDr6GhSg.png" /><figcaption>iPhone | Safari: 100% and 200% page zoom</figcaption></figure><p>If you take a closer look, you will see that after the page zoom, the size of individual elements haven’t changed but the size of the viewport has decreased. This makes the elements look larger (except for <em>vmax </em>unit that depends on viewport size and eventually renders with the same size).</p><p>Using page zoom for text resizing has several strong advantages:</p><ul><li><strong>All elements scale consistently</strong>, no matter what length units they use.</li><li><strong>The scaling can be easily detected </strong>with <em>@media</em> queries in CSS, and the layout of the page can be adjusted.</li><li><strong>Adding new breakpoints for adjusting layout is easy</strong>, if the webpage already uses responsive design (and it really should).</li></ul><p>In this example, viewport width has shrunk from 375px to 188px. When designing a webpage, one probably doesn’t expect 188px screen width to be a possibility these days but apparently, this can happen with the page zoom. In our team, we decided to add an extra breakpoint for our views at 250px at which we reduced paddings and hid non-essential decorative elements to give more space for content.</p><h4>Summary</h4><p>In my opinion, page zoom is the most elegant and robust solution for text resizing. It is also relatively easy to support as a part of a responsive design solution. Unfortunately, it’s not available everywhere.</p><h3>iOS | Chrome: Intro to Text Zoom</h3><p>Let’s switch to another browser on iOS — Google Chrome. Although Chrome for iOS is built on top of WebKit developed for Safari, it has a different approach to text resizing — text zoom.</p><p><strong>Text zoom</strong> means that as a user changes the zoom level, only text elements scale while the others stay of the same size.</p><p>You can find the setting in Chrome for iOS at the bottom of the menu that appears when you click the three-dots button. Let’s set it to 200% and see what happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*QbW_ZqWMVlGl7otpG_vGfg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*s6zwg7Xy27kaR2N7KhDWeQ.png" /><figcaption>iOS | Chrome: text zoom at 100% and 200%</figcaption></figure><p>We can observe several peculiar things resulting from 200% text zoom:</p><ul><li>Viewport size hasn’t changed.</li><li>All text elements scaled, no matter what units they used.</li><li>Non-text elements using <em>rem unit </em>(root element font size)<em> </em>didn’t scale up. To explore this behaviour further, a special case of <em>em </em>unit was added, and it is possible to see that non-text element using <em>em</em> did scale up together with the corresponding text element. What is intriguing is that these <em>em </em>units end up referencing the same value as <em>rem </em>above. The case of <em>rem</em>-based elements<em> </em>not scaling looks very much like a bug.</li><li>Text elements using <em>vmax </em>get scaled but not images.</li></ul><h4>Summary</h4><p>Besides the issue of non-text elements not scaling with <em>rem </em>unit, Chrome for iOS provides quite consistent implementation of text zoom. We will see both better and worse examples on Android..</p><h3>Android | Chrome: Text Zoom that doesn’t work</h3><p>On Chrome for Android text resizing can be done with the “Text scaling” setting that can be found under the “Accessibility” menu option. As the name suggests, only text elements should be affected by it, so this is essentially a text zoom.</p><p>Unfortunately, “Text scaling” in Chrome for Android <strong>does not seem to be working properly</strong>: current implementation of this feature is tied to autosizing (a feature made a long time ago for websites with poor support for mobile devices). <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=645717">The bug</a> was initially reported in 2016 and as of January 2022 it is still not completely resolved.</p><p>To describe the severity of the issue, it’s enough to say that initially our test web page didn’t get affected by the text scaling setting at all. Some usages of flexbox had to be removed to make text elements scale properly which affected the way the page elements render.</p><p>Let’s see how things look after the necessary adjustments on Pixel 5 running Android 12 with 200% zoom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*a60MxpXDkZyWHwOotADEyg.png" /><figcaption>Android | Chrome: 200% text zoom</figcaption></figure><p>It is possible to notice that:</p><ul><li>All texts that have no size constraints set by parent and are not part of flex container have scaled up, no matter what units were used.</li><li>Non-text elements didn’t scale up, no matter what units were used.</li><li>Text elements within size-restricted containers didn’t scale up (look at numbers inside circles).</li></ul><p>In addition to the observations above, one interesting aspect is that the scaled font size depends on the size of its parent container. In a small container, the text might not scale at all — it gets gradually bigger as the container width increases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*1BdQaa-eH-fMg2oW1QMa8A.gif" /><figcaption>Android | Chrome: text scaling increasing with the size of container</figcaption></figure><p>In the thread related to the issue, other behaviors stem from text autoresizing feature, such as text elements only being resized if their length <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=779409#c44">exceeds 217 characters.</a></p><h4>Summary</h4><p>The text scaling feature seems to be non-functional on Google Chrome for Android. This should be fixed since this makes the browser itself not compliant to <a href="https://www.w3.org/TR/UAAG20-Reference/#gl-text-config">User Agent Accessibility Guidelines</a>. Unfortunately, there is not much we can do with this as web developers.</p><h3>Android | Firefox: Predictable Text Zoom</h3><p>In a similar fashion to Chrome, Firefox for Android has a “Font size” setting under the “Accessibility” option in its settings. It’s equivalent to text zoom.</p><p>Let’s see how things look with 100% and 200% zoom on Pixel 5.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*s8jlHyK1H6g9NOWQdGo6iw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*fSo2pm_f-z4Lg27oUbMK8g.png" /><figcaption>Android | Firefox: Text zoom 100% and 200%</figcaption></figure><p>Here is what we can see:</p><ul><li>Viewport size hasn’t changed.</li><li>Text with<em> px</em>, <em>rem </em>and <em>em </em>units scaled.</li><li><em>Rem- </em>and <em>em-</em>sized images scaled, <em>px</em>-sized didn’t.</li><li>Elements with viewport-based units (<em>vmax</em>) didn’t scale.</li></ul><h4>Summary</h4><p>In my opinion, Firefox for Android provides the most predictable result of a pure text zoom:</p><ul><li>Text using both <em>px </em>and <em>rem</em>/<em>em </em>scales up. This covers most common use cases.</li><li>It is possible to define the size of any element to be in sync with text size by using <em>rem </em>units.</li></ul><h3>Android | Samsung Browser: Text Zoom with some issues</h3><p>Samsung Browser for Android has a similar dedicated setting called “Webpage text size” which works like text zoom. It can be found (rather deep) under the “Appearance” option in Settings. Let’s compare its effect with 100% and 200% value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*vFXRv9fD2bK0GQVFQMDI5Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*pyjx798bZ9WUoRB2CVYbNQ.png" /><figcaption>Android | Samsung Browser: Text zoom 100% and 200%</figcaption></figure><p>We can see that:</p><ul><li>All text elements scale, no matter what units are used.</li><li>Value of <em>rem</em> unit is not changed, so it’s hard to keep the size of other elements coordinated with the text.</li></ul><h4>Summary</h4><p>“Text size” setting in Samsung browser scales text elements predictably. Unfortunately, there is no way to make other types of elements scale at the same time, from what I’ve seen..</p><h3>Desktop | Firefox: One Browser to Rule All the Settings</h3><p>When it comes to content scaling in general, Firefox developers “did their homework,” as this browser offers the widest range of configuration options. Let’s go through them and check how they affect the test page.</p><p>In the image below you can see a reference webpage without any scaling settings applied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*guPB6K4oHYEr9gyeo-3Jsw.png" /><figcaption>Desktop | Firefox: Original page with no text resizing enabled</figcaption></figure><p>Let’s start with page zoom (can be triggered with CTRL or CMD key + plus/minus key).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*ix9xreSGlnj0cnyJgtv7Jg.png" /><figcaption>Desktop | Firefox: 200% page zoom</figcaption></figure><p>We can see the expected behavior: viewport is shrinking, and all the elements are increasing on the screen respectively, except for <em>vmax</em>-sized elements.</p><p>Let’s try something else: the “Zoom text only” checkbox in “Language and Appearance” section of settings. This setting essentially turns page zoom into text zoom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*XUq-tQTVqVOgUrrj6Bx4mw.png" /><figcaption>Desktop | Firefox: 200% zoom with “Zoom Text Only” checkbox</figcaption></figure><p>Again, the behavior is very much expected for text zoom: <em>px </em>and <em>rem </em>text elements scale up, non-text elements using <em>rem</em>/<em>em </em>units as well. However, interestingly, <em>vmax</em>-based text didn’t scale up. This is not right or wrong, in my opinion, as there is no clear standard regarding the priority of text zoom setting.</p><p>Additionally, in Firefox another parameter can be used to tweak the size of the text: <strong>default font size</strong>. Let’s increase it from 16 to 32 and see what happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*k33yP925qarSp4p3stgAyg.png" /><figcaption>Desktop | Firefox: Default font size setting increased by 200%</figcaption></figure><p>As we can see, default font size is affecting only the size of <em>rem</em>/<em>em </em>units, both for text and non-text elements, which is expected.</p><p>Another interesting setting worth mentioning is the minimum font size. Let’s set it to 12 and try scale down the page by 50% with the “Zoom text only” checkbox checked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*HkXTLdrMNuu2aoBISFcwhg.png" /><figcaption>Desktop | Firefox: Text zoom at 50% with minimum font size set at 12px</figcaption></figure><p>As expected, all text elements don’t get smaller than 12 pixels, even the ones using <em>vmax </em>units. This does not apply to non-text elements using <em>rem</em>/<em>em </em>size as they continue to shrink, which can be a potential source of inconsistencies.</p><h4>Summary</h4><p>When it comes to text resizing, Firefox can be your go-to browser during development. It offers all possible content resizing settings and they work as expected.</p><h3>Desktop | Chrome, Edge, Opera: Page Zoom and Font Size Settings</h3><p>When it comes to the desktop version of Google Chrome and its Chromium-based “siblings” Edge and Opera, the behavior is identical to Firefox, but the browsers do not offer all the configuration options.</p><p>It is possible to set a default and minimum font size, affecting the size of <em>rem </em>unit and all text elements, respectively.</p><p>But there is no “Zoom text only” checkbox so only a regular page zoom is available.</p><h3>Desktop | Safari: Page Zoom is the Way</h3><p>Safari for macOS does not feature a variety of special text resizing options. Apart from a standard page zoom, which works the same way as in other browsers, you can find an accessibility setting called “Never use font sizes smaller than” which is similar to the minimum font size in Firefox and Chrome.</p><h3>Summary</h3><p>We’ve seen several ways to achieve text resizing in web browsers.</p><h4>Page Zoom</h4><p>Controls the size of the viewport without changing size of individual elements. The consequence of a page zoom is that the on-screen dimensions of all elements change at the same time.</p><p>Handling of page zoom is straightforward and can be partially done by responsive design techniques like <em>@media</em> queries in CSS.</p><p>Page zoom is a primary content resizing feature for all desktop browsers and Safari for iOS, given how easy it is to reach this setting for the user.</p><p><strong>Catch:</strong> Older iPhones have only 320px screen width. Thus, in Safari with 200% zoom, a webpage ends up having just 160px width. Make sure that your layouts can handle this.</p><h4>Text zoom / text scaling</h4><p>Affects the resulting dimensions of text elements only. <em>Rem </em>units can be used to scale other types of elements as well, but implementation varies across browsers. In some of them, <em>rem</em>-based dimensions won’t scale for non-text elements (see Samsung Browser or Chrome for iOS).</p><p>Text zoom is the primary resizing setting for all Android browsers and Chrome for iOS. The desktop version of Firefox can have such behaviour enabled as well — this can be handy during development and testing.</p><p><strong>Note:</strong> Chrome for Android has long-running issues with text resizing (as of time of writing). It is nearly impossible to overcome them without major impacts to the design and layout of the page.</p><h4>Default font size setting</h4><p>Offered by Firefox and Chromium-based desktop browsers, it allows the user to change the default value of <em>rem </em>unit. Thus, elements using absolute units like <em>px</em> won’t be affected.</p><p>It’s hard to say how often this setting is tweaked, as many websites do not respond to it being changed. Most likely, if your designs work well with the above-mentioned text zoom, they will handle default font size setting as well.</p><h3>Conclusion</h3><p>Text resizing is a hard problem in web development: there are multiple settings affecting text size (page zoom, text zoom, default font size), varying implementations across browsers and no single formula to make things work consistently.</p><p>The closest you can get to a universal solution is using relative length units like <em>rem </em>for font size and for dimensions of elements that should scale together with text. But even in this case, expect minor inconsistencies.</p><p>The good part is that by using Firefox during development and tweaking available settings you’ll be able to test the behavior of all existing text resizing techniques.</p><p><em>Did I miss anything important? Please, let me know in the comments or reach out to me on </em><a href="https://twitter.com/iansavchenko"><em>Twitter</em></a><em>.</em></p><p><em>Special thanks for peer reviews go to my colleagues </em><a href="https://se.linkedin.com/in/gbgomes"><em>Gabriel Gomes</em></a><em> and </em><a href="https://hallski.org/"><em>Mikael Hallendal</em></a>,<em> as well as </em><a href="https://medium.com/u/592aed2a2f2d"><em>James Carleton</em></a><em> and </em><a href="https://medium.com/u/335e19aa2303"><em>Kiersten Lammerding</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bed9e424e071" width="1" height="1" alt=""><hr><p><a href="https://medium.com/paypal-tech/designing-for-accessibility-how-text-resizing-works-in-different-web-browsers-bed9e424e071">Designing for Accessibility: How Text Resizing Works in Different Web Browsers</a> was originally published in <a href="https://medium.com/paypal-tech">The PayPal Technology Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>