Let’s fix the web’s text size

Speaker Introduction and Community Welcome

Bruce Lawson introduces Josh Tumas from the BBC with characteristic humor. Josh thanks the audience, introduces himself as a BBC senior software engineer working on the BBC Design System, and shares that he joined the CSS Working Group two summers ago. He encourages attendees to engage with the community and credits the conference itself with giving him the confidence to apply to join the Working Group, setting up the talk's focus on WCAG accessibility guidelines relating to text scaling.

WCAG Text Scaling Requirements and Established Best Practices

Josh outlines the relevant WCAG success criteria, specifically that websites must support at least 200% text resize without breaking layouts or causing horizontal scrolling. He reviews the established best practices developers have been taught to follow: designing mobile-first and always using font-relative units like rem and em rather than pixel values, including within media queries — rules Josh notes the BBC itself strives to follow.

The BBC's Accessibility Complaint: Text Not Scaling in Web Views

Josh describes a real accessibility complaint the BBC received: users who increased their phone's OS text size found it had no effect on the BBC's live feed page, despite working on other native app screens. He reveals the cause — the page was a website rendered inside a web view — and cites research showing approximately 37% of users globally change their text scale settings on iOS or Android devices, underscoring how serious and widespread the issue is.

How Browsers Handle Operating System Text Scaling Inconsistently

Josh demonstrates that the text scaling problem extends well beyond web views to regular browsers. Chrome on Android does nothing when OS text scale is increased, Firefox performs full zoom rather than text-only scaling, macOS text scaling appears to have no effect on any app, and Windows 11 scales everything including the browser chrome itself. This segment highlights the significant and confusing inconsistency across platforms in responding to accessibility text size preferences.

The Real-World Consequences: Text Scaling Breaks Modern Websites

Josh demonstrates what happens when text-only scaling is enabled via Firefox across popular websites including Google, Bluesky, Apple, LinkedIn, and Disneyland Paris. Navigation bars become truncated, icons overflow, and fixed-width content areas fail to accommodate the larger text. He argues this evidence shows why text scaling cannot simply be switched on universally — websites need an explicit way to opt in to correct scaling behavior, and most are not yet ready.

CSS Working Group Proposals: From Environment Variables to the Meta Tag

Josh explains how he raised the issue in the CSS Working Group with help from two Chrome team members, David Grogan and Phil Rogers, resulting in a formal explainer document. He walks through three successive proposals: a new CSS environment variable called preferred-text-scale, a syntactic sugar unit called pem (preferred em), and finally the approach that gained traction — an HTML meta tag with name=text-scale and a content value of either scale or legacy. He also notes ongoing privacy discussions around fingerprinting risks from exposing the exact scale value.

How the Text Scale Meta Tag Works with REM Units and Media Queries

Josh explains the mechanics of the meta tag solution, clarifying that it works by changing the browser's default font size rather than a CSS-level root override. He addresses a key quirk: media query rem values are always based on the browser's initial font size rather than author-defined values, which is precisely why the meta tag approach was necessary. He notes the feature has limited availability in Chromium browsers already and expresses hope for Firefox and Safari support later in the year.

Testing Your Website for Text Scaling Accessibility

Josh explains how developers can test text scaling behavior on desktop browsers today: using Chromium's font size slider in appearance settings, Firefox's zoom-text-only option, and Safari's hidden option+cmd+plus keyboard shortcut. He recommends combining browser viewport emulation at 320px with text scaling to simulate the most challenging scenario — equivalent to a mobile user who has also zoomed in — and uses a BBC Weather page as a live example of the kinds of breakages to look for.

Design Principles: Starting Scaled Up and Using the Right Units

Josh presents his first four practical recommendations for building text-scaling-ready websites. He advises designing mobile-first with text already at maximum scale, avoiding overriding the browser's default font size with pixel values in CSS resets, using rem units in media queries so layouts respond appropriately when text grows larger, and reserving pixel units specifically for gaps, margins, and padding — where fixed sizing actually improves readability by preventing spacing from growing disproportionately.

Layout Strategies: Single Column Breakpoints and Intrinsic Sizing

Josh covers two further recommendations: switching to single column layouts at around 300px equivalent rather than 320px to give moderately scaled text a little more breathing room, and using container queries as an even more robust alternative that adapts contextually. He also stresses intrinsic web design — never setting fixed heights on elements like navigation bars, using min-height instead so content expands naturally — and recommends Ahmed Shadeed's Defensive CSS website as a practical reference.

Managing Large Heading Sizes and Opting In to Text Scaling

Josh addresses the specific challenge of headings, which can become unmanageable when text scaling is applied at full intensity. He demonstrates a CSS formula using the preferred-text-scale environment variable that reduces the rate at which headings grow relative to body text, and mentions that CSS functions make this pattern more reusable. He closes by encouraging developers to start using the text-scale meta tag now to benefit Chrome and Android users immediately, and highlights a new MDN article covering the full feature.

Audience Q&A: Browser Support, Unit Strategy, and Biscuit Preferences

Bruce Lawson facilitates audience questions covering: whether the meta tag works with pixel font sizes (it does not — only font-relative units scale), whether using pixels for margins and padding is genuinely advisable (Josh confirms yes, with context), the current state of Firefox and Safari support (Firefox approval received that week with implementation potentially arriving within the year), fluid typography and clamp() considerations for the root font size, and why the opt-in mechanism lives in HTML rather than CSS. The session closes lightheartedly with questions about biscuit preferences and the merits of visiting Salford.

Our next speaker is a nice chappy. He works with the BBC. He doesn't know the difference between Britney Spears and Kylie Minogue, we've discovered. And, he was raised by badgers from an early age, and he speaks fluent badger.

So ask him about that later. Without further ado, all the way from sunny England, Josh to Mass. Take it away, Joshua.

Well, thank thank you very much. National treasure, Bruce Lawson. I always call him that. International Absolutely. I just don't know if I have the jurisdiction to make that declaration. So, yeah, what a privilege to be here. Nice to meet you all. My name's Josh. So typical introduction slide here.

So I work at the BBC, senior software engineer. I work on the BBC's design system. One of my colleagues, Nat, is here, solemn barrister. You're welcome. And I also had the privilege of joining the CSS Working Group about two summers ago. So that's been a really wonderful experience. So, you all know the CSS working group, right?

So this conference, I've got to tell you, it is absolutely fantastic. Put your hand up if it's your first time at this conference. Really? Oh, that's so wonderful. There's so many new people here. So how dare you take a seat from people who've been before. No, that's not what that's not what's going on here. Thank you so much for coming.

This is such a wonderful community. It is such a great place to meet people. The only reason why I had the confidence to ask my employer if I could join the CSS Working Group is because of this community right here at this conference putting me at ease, making me feel welcome. So thank you so much for that.

Do, please do take the opportunity to chat to as many people as you can. Just Pac Man yourself into any kind of conversation because, and just, that's what I, I'm an extrovert, that's what I do, but like, just shove yourself in there. It's such a great way to meet people. There's so many people from the CSS working group here so you can lobby us about anything so that we can ignore you.

That's not true. But what we're gonna be talking about today is the font specification or maybe something more in the HTML specification. So we're gonna be talking about stuff relating to these web content accessibility guidelines. So put your hand up if you followed the WCAG guidelines or you try to for your website.

Great. So maybe you'd feel a bit ashamed if you didn't put your hand up then. I don't know. No pressure. So obviously you know resize text off by heart. That is, you don't really. But one that success criterion says that we should be able to resize our text on our websites by at least 200% without anything breaking or without us preventing that from happening.

Likewise, we should be able to when we resize our text or even without resizing our text or zooming, we should be able to do that without the page reflowing. Without you know, know, if you've been on a page where it kind of horizontally scrolls when it shouldn't really be able to do that, we want to prevent that from happening as well.

We should be able to only scroll in one direction when we resize our text. And as web developers, we generally have been taught these best practices if you're experienced, if you've been doing this for a while. So the first one is to design your website mobile first. You might have heard that phrase before. So when you're starting to design your website, you wanna start off with that mobile design first and then build up to the desktop.

It's really hard to start off with the exciting desktop design and then drill down from there. I'm gonna get a quick drink because my mouth's getting dry already. And then awkwardly comment on it while I do that because I'm an extrovert and I just have to explain everything I'm doing out loud. Now you have to awkwardly stare at me while I have a drink.

Sorry. So, oh, that's so much better. So, do you ever compare the different water you go to in different countries? Don't go to London. It's awful. So, yes. So what have we got after doing responsive web design, mobile first? So also, you might have been taught this as well. Never ever ever never use pixel units.

Always use font relative units like rem units, em units to style, set sizes on everything on your website. And perhaps even use those units in media queries as well. So we were follow we always follow these rules at the BBC, know, because we're just so perfect obviously and never make any mistakes. That's not true. But so we had this complaint.

So it turns out we're not perfect. So the complaint was this. So we have lots of apps in The UK for for news, sports, weather, and so on. And so our sports app, someone was using the app in The UK. They'd increase the font size on their phone.

And so they go on a settings page like this. This is what it looks like in Android, on Pixel devices anyway. And so you'd increase that slider. And then low and behold you would find your native app, the text has gotten bigger. So they did this as well on our live feed page. So they increased the text size in the same process.

Oh, nothing happened. What's going on here? The text size is completely exactly the same. Nothing has changed. This is an accessibility failure. It is It was a very legitimate complaint that we received about this. But why has this happened? Well it was because this page, dun dun dun, is actually a website. It's in a web view.

So what's going on here? If you don't know, web view is a way of embedding a web page in a browser. It's a bit in in a native app rather. It's a bit like an iframe I suppose. I mean I wouldn't know. That that's that's the most I know about it because I'm not a native app developer.

But that's what's going on here. And this is like quite a serious issue because, so there was an organization called Appt, you can check the source there. They did some research that showed about 37 of your users, generally worldwide, will change the text scale on their IOS or Android devices.

Put your hand up if you increase the text size on your phone. So there's quite a lot of people here actually. Maybe not quite as much as 37%. But I just wanna say to you, those of you who have not increased your text size, just wait till you get older, it might happen. So this will affect you too.

It'll definitely affect me one day seeing as my family all seem to get glasses by the age of 40. So we're wondering, well, why isn't this works? Like, we're we're following all the best practices. Why isn't the text getting bigger? We we've been sold this lie that if we just use rem units, the text size will get bigger.

What is going on? Well we can see it's clearly a lot more complicated than that, just as everything else the CSS web group seems to deal with. So what's going on here? So here's what happens if you just, so forget the web view now. If you just go browsing around on your favorite web browser, say you're on Chrome on a Pixel device, Increase the text size and well, lo and behold, nothing has happened.

What's going on here? Put your hand up if you use Firefox or Android. This is probably the only place I'd ever go to where more than one person will put their hand up. I do too. I love it. Are you proud of me, Jake? Oh, thank you. So I think it's great. So now interestingly, when you increase the text size on Firefox, have you seen what happens?

It it does make things bigger, but this isn't this is not the text getting bigger. This is everything getting bigger. This is just normal zoom. So what's going on here is Firefox actually has a little tick box in their settings where you can enable this. This is the default. It will do zoom in response to text scaling.

So that's okay. That's quite helpful actually. Now on Mac OS, did you know that had a text scaling setting as well? If you increase the text scale on there, nothing happens. Not just on like your favorite web browser though. Nothing hap seems to happen on any app. None not even the native apps. Nothing happens on Mac OS when you increase the text scale.

So I don't know what's going on there. That's interesting. On Windows, at least on Windows 11, the opposite thing happens. Like everything gets bigger. Like not just like with Firefox where the content gets bigger. Everything, even like the browser Chrome itself seems to get bigger. So that's interesting. There's quite, as you can see, a massive disparity between how desktop browsers are responding to these settings as well as mobile browsers. But here's the thing.

So within the browser UI itself, you can increase the text size. So we'll talk about it later but yeah they all have settings for increasing the text size in some way. So anyway, as we can see, this is a bit of a problem. So 37% of your users are increasing their text size and nothing is happening when they go on the web.

That's a bit of a problem. So kind of just after I joined the CSS Working Group, I raised an issue on this. And we're basically wondering, so like, oh crap, which was my glass? The one on the left. Oh, it was the one on left. Your left. Thank you so much.

That that could've ended. I'm gonna move this away. Oh is it empty? Oh I didn't even have to worry about that anyway.

Great.

So, where was I? Yeah so in in reported the issue and like, so you'd probably reasonably ask, well why is the text size not just getting bigger anyway? Can we not just do it? We do it on desktop apparently. So why can't we just do it on mobile? And and it's a reasonable question to ask probably.

But well, there's a reason why we don't. So let's see what happens when we increase the text size on a random set of websites. So we'll go on Firefox. We're gonna tick this little ZoomText only box on the settings or you can do it on the view menu in the the menu bar. Or you can even set a specific default font size that you want if you want to do that as well.

Let's go on Google. So what happens is the navigation bar gets completely or partially obscured by the search bar. The icons seem to still get stuck in the top right of the search bar as well. The main content area though seems to be fairly readable. If we go on Blue Sky, again there is a slightly chopped off overflowing menu and I don't think there was a way for me to scroll to see what else was on the menu.

Same on Apple's website, we get a very truncated navigation bar. But at least on this homepage, the main content still seems to flow. On LinkedIn, it gets even worse. Like, so yeah the the navigation bar has again been squashed and single words don't even fit on one line anymore. We've got like the search icon poking out of the search bar for some reason. And then worse still, like the main content area hasn't increased in its fixed width to accommodate this wider, larger text.

So what's going on there? We can see lots of dot dot dot truncation going on. The Disneyland Paris website is an interesting one as well because that has a big hero image on it. And suddenly when the text overflows their navigation bar, now it's not good, got good color contrast either. So as we can see, it's an absolute massacre of navigation bars apparently. Which makes sense because they're probably the main thing on your website that has like a a firm horizontal layout on desktop.

Of course though, in this very contrived specific example, the BBC website is perfect. So I just have to point that out. So that's good. So basically our websites, they're not ready for text scaling are they? They're they're just not ready for this unfortunately. There's quite a lot of areas on the BBC website that really isn't ready for this as well.

So clearly we can't just turn this on. Like we need a way for us as authors, as web developers, to opt in to this correct behavior where we are somehow responding to the operating system setting tech tech scale. So so at this point, very kindly, two people in the Chrome team started helping me out with this.

So that's David Grogan and Phil Rogers. So I wanted to give them a shout out and make sure they get lots of credit for this as well. But basically we together put together what's called an explainer. So this is where we make like a a big document that kind of explains, as the name suggests, how a proposal for a new feature on the web platform will work.

And what we proposed was this. It was a new, did you know CSS had environment variables? So it was a new environment variable called preferred text scale. It took a lot of bike shedding to get to that name. But basically it would work like this. So if the user doesn't touch their text scale settings, then this environment variable would equal one.

If they increase it by a little bit, it would have a value of say 1.25. If they double it, it would have a value of two. So the way you would use it is like this. You might use it in calcs. Say you're setting the text size of a button, then you can just do 16 pixels times whatever the environment variable value is.

But that's a bit of a, sorry I'm gonna use a British word now. That's a bit of a faff. That's a bit of a pain because you probably want to do this in a lot of places and you don't wanna set up all these calcs everywhere. So we came up with this idea of a syntactic sugar called the pen. So the idea is this would be the preferred M.

So there you go. So it would basically just do that calculation for you. Let's go for another drink. I I have Tourette's Syndrome by the way, so if you see my eyebrows moving a lot, it's not because I'm enthusiastic, it's just it's just a tick. So the it's just when you look back and you talk on the livestream and you're like, I've used to move my eyebrows so much. So yeah, this is a bit of a fail as well, this suggestion unfortunately. It seemed like it had good traction but the problem with it was you've already worked so hard to put RAM on your websites and stop using pixel values everywhere.

So why should we be coming along and telling you, oh stop using REM now actually. Use use this PEM value. So we ended up with this third proposal. So it was basically to introduce a new meta tag. So the idea was you would just specify this meta tag on your page and just, it it would just do what you want.

It would just set the new default text size to be whatever the user has set it in their operating system accessibility settings. And that would be great. So you would use that where you would a normal meta tag. So in summary, what we've ended up with in this proposal to solve this problem is this. So we've got this meta tag now, name equals text scale, content equals scale. So it's like an enum.

So the other value is legacy. So we wanted to call it legacy. This is the old behavior that we should not want anymore. The way things work now, that is legacy. And then if we want things to scale, we set content to be scale. But if you need to opt in more selectively or you've got particular situations where you need to get this scaling value, then you can still use the environment variable.

There has been some fingerprinting concerns around this that we're still working on in in the working group. So the concern is if we're just getting the exact text scale value that the user has set, could fingerprint us use that to track you as like an extra way of identifying you like, oh, this person, they set the text scale to this and they've got this dark mode setting turned on.

And you know, if you combine all these settings together, becomes a good way of getting a profile of someone. So people are thinking quite carefully around how to support this value without giving you, oh this user has set their text scale to 1.2567 whatever. So it needs to be carefully done there. So the idea is you would just use it like this.

So you would just set it in your head of your HTML or just remove the head if you're cool. And this HTML pass will add it back in for you. And you would just set it. All the stuff you've done before, it works. So say you've set the font value to two rem. So before that would have been 32 pixels.

But now the default font size is 32 pixels. So 32 times two is 64. Same with if I used it in a media query. And in the media query itself, again, it would multiply the REM value in the media query. Now why do I talk about media queries? So there's an interesting quirk here with media queries.

So so basically what's going on behind the scenes is so the, in the browser's default style sheet, it doesn't set 16 pixels for the root font size. It doesn't happen in the browser's default style sheet. What's happening is in the initial value for the font property in CSS, The value is called medium.

You probably never use medium, but this is what the value is basically. So median pretty much always equals 16 pixels by convention. No one is saying it must be 16. But by convention, it is 16 unless someone does something in their settings to change this value. So that's what's going on there. If I set one rem, of course, you get 16 pixels.

And then that's the same in the media query. If I put 10 rem, well 16 times 10 is 160. That's great. But if you yourself change the root font size to say 20 pixels, Well, yes, the Oh, hello clicker. Oh. Come on PowerPoint.

Don't let me down. Come on. There we go. I lost focus and selected the text box instead. So yeah, you would get 20 pixels for that value. But, oh come on, don't do this to me. Don't do this to me. Don't fail on me now. Oh, for goodness sake. I have to click a little button now just to progress the slides. So yeah, you would get 160 pixels.

So what what's going on here? Why is it not 200 pixels as we would thought for the media query? Well, there's this little note in the meta media query specification. And it says this. So, oh, let me have a drink before I read this. So relative length units in media queries are based on the initial value, which means that units are never based on the results of declarations. For example, in HTML, the EM unit is relative to the initial value of the font size defined by the user agent or the user's preference, not any styling on the page.

So basically what that means is cry. So basically anything you do in user land or author land to change, to fiddle with any font relative units will have no impact on media queries. It will on Container Queries though, but not on media queries. So this is why we needed the meta tag.

We needed to be able to change the browser's default font size. We didn't just need to provide you as authors a way to set a new root font size. We needed to change the browser's default font size. So very excitingly, this is starting to be implemented in browsers now. So there is limited availability for this in Chromium browsers.

So Chrome, Edge, Vivaldi, and so on. Not yet in Firefox or Safari, so hopefully there'll be progress on that later this year. Really exciting to see this announced at Google IO, so shout out Brahmas wherever you are. Thanks to that Brahmas. Thank you. That was great. So yeah, it's great to be getting the word out on this.

So let's come to the really important part of this talk, which is how do we as authors test our own text scaling? Watch out. You're not gonna be happy with your website. So just to remind ourselves, we wanna make sure in the WCAG guidelines we are at least supporting 200% text size increase.

And when that happens, we don't want to cause the website to kind of scroll horizontally in the process of doing that. But here's the thing. We wanna do better than this. Because the fact is users can and do increase their text size by more than 200%. So at the operating system level, so there's different maximums on each operating system. So at least on Pixel devices, Android, it is only just up 200%, you can increase it.

On iOS devices, it's more. It's actually around 310%. On Windows, it's 225%. And on Mac OS, it's 350%, although it seems to have no effect anyway. And then of course on desktop browsers, I think they can go up to as much as I think 50 per 500% in Firefox and it'll be different in each browser.

But I haven't looked into it. But it is more than this and people do use that. So how do we test it on our desktop browsers? So we saw that desktop browsers do do this. They do support text scaling. So how can we kind of simulate what it would look like on your phone when you increase the text scale?

So this is how you do it on different browsers. So on Chromium browsers, you'll be able to dig through the appearance setting and you'll be able to find in there a setting where you can, on a slider, select the actual font size value that you want. As I showed you earlier on Firefox, you can tick the zoom text only setting.

And when you do that, that will, when you when you do stuff to zoom in, it will just increase the text size instead. So when you're pressing command plus, command minus, it'll just do that. And then also on Safari, it's kind of hidden on there. So you have to hold down the, I'm looking what it's called on my Mac keyboard, the option key and the command key and then press press press plus and minus, and that will actually just increase the text size.

So you'll see that in the the menu bar, the label changes to make text bigger. Suddenly I haven't made the text bigger for myself when I'm trying to read it. So let's imagine you are now a user on a mobile phone on some device. We often imagine that the smallest device width these days is often around 320 pixels. So I suspect you will probably are testing at that range when you test on mobile devices.

But the thing is, when a user has zoomed in by say 200%, so not even talking about text scaling right now, just zooming in. If they've zoomed in by 200%, then that effectively makes the viewport actually 160 pixels wide. So if you've, if you're still supporting like little feature phones like Nokia's, you're you're probably doing a great job here actually.

So yeah, basically what we wanna do is go on your viewport emulator setting on your favorite browser, increase that, decrease that down to 320 pixel width and then start to increase the text scaling. Double it. See what happens. So as you can see in this example here on the BBC Weather website in The UK, it's not looking good.

We've got the logo for weather overflowing at the edge of the page. And in doing so, it's also covering up the search bar. And thankfully the main content doesn't look too bad. But we can see the menu bar at the top starting to get a bit squashed. And if we went over 200, there would not be enough room for all of that stuff to fit horizontally.

So it's a bit of a problem there. So how can we make sure our websites work with text scaling? So what I'm gonna talk to you about now applies whether you're making a brand new website from scratch or whether you are trying to retrofit this in what you have now. And let's start with this. So make sure now, so if you are starting from scratch, don't do mobile first anymore.

Do mobile first with the tech scaled up. So think about it this way. Think about that user like Alex in the room here who has kindly modeled his hand for me in his phone in this photo. What, put your hand up Alex. Where are you? He doesn't want to embarrass. There he is. Look at look at Alex's beautiful hands there modeling this phone. So everyone's actually turned around so look at his hands.

So So yeah, so you can see an example here of where he's increasing the tech scale. And sure enough, we wanna make sure you are designing your website, thinking about those users who have scaled it up to the maximum first. Second thing is don't, try not to touch the default font size in your kind of CSS reset or whatever that you might do on your page. So if we just override the default text scale val, sorry the initial font size in the root element to say 10 pixels, just to make the maths a bit easier when you're calculating things, please don't set it to an absolute length value like pixels because that will just turn off any text scaling behavior.

So likewise, even if you're setting it to 16 pixels, we've got the same problem. What you could do is if you really want to do this, you could use a percentage value. So if you wanted it to effectively equal 10 pixels by default, then you could just set it to 62.5%. That's fine. But I recommend just not touching it all and just leaving the text scale as it is.

The next thing is to be very careful with how you use pixel units for layouts as well. So think back to that LinkedIn example we saw where the kind of main column there wasn't getting any bigger to accommodate that text size. So I've just made a simple website here. Nothing exciting. But of, I imagine, some sort of sport of pet Roomba wrestling. I just got very inspired by this image.

So let's say you're doing a standard website layout. You've got, say, your blog, your news article, whatever it is on a main column. And then you've got a sidebar column. So we all do this. You probably do something like this. Maybe you lay out a flexbox or grid and you have a media query value that, you know, maybe around 900 pixels, something like that, you that's when you display this sidebar.

But any viewport smaller than 900 pixels, you just have a single column layout. Well the problem is, when the user increases their tech scale, suddenly now everything gets a bit squashed in that sidebar. Doesn't have much room to breathe anymore. So maybe what you're tended to do is you now set the width of that sidebar using say rem units rather than the pixel units. And what ends up happening is like, okay, cool, great.

The the sidebar's gotten bigger relative to the text, but now the main content's being squashed. So this is why it's really important to start using these rem units in media queries. As So soon as we do that, the page is like, right, okay, I've only got enough frame at this text scale to have a single column layout.

So let's have a single column layout. And that solves the problem. Also, only, so when should you use pixel units? That's what we wanna know. Because it's not, we're not banned from using pixel units. There are very very legitimate reasons why you should use pixel units. And the way I generally advise people is so use those relative or proportional percentage units for sizing your content.

So we're thinking about text. We're thinking about maybe icons, maybe not icons. People have, people kind of debate that. But make sure your text at least is scaled with these rem units and your layouts as well. But when, so where it's appropriate to use these absolute length units like pixels is basically when you're setting stuff gaps, margins, padding.

So you can see here in this example where we've done that, you can see how we haven't increased the padding in these boxes. We haven't increased the gap in our grid layout. So that content just has that little bit more room to breathe. We're not kind of squashing it in with even bigger padding that takes up loads of room.

And then fifthly, so only use single column layouts on very small viewports. And when we say really small viewports, we're talking about those kind of feature phone sized ones. When, you know, if someone is using a normal mobile phone and they zoom in or they increase the text scale, as we were saying, they've effectively got a smaller viewport now.

So that's where even a simple single column layout just doesn't work for you anymore. So you probably have a card like this on your website. We call them promos in the BBC for some reason. But yeah, you can see here how there's just, you know, if we wanna have an image on the left and text on the right, there's just no room for that anymore.

There's, you can barely fit one word now in that kind of layout. So try and switch that to a single column layout on everything basically. The where, so when we do this, we've chosen like 300 pixels equivalent rather than three twenty pixels for the bit where we switch. And the reason for that is because a lot, probably realistically most users will only zoom in or increase the text scale a little bit. So when they increase it a little bit, like that's normally fine. They do still have a little bit of room for a two column layout.

It's when people start to increase it by 150%, 200%, that's where we need to do these kind of extreme measures. But generally for most people, that 300 pixel equivalent, whatever that is in units, breakpoint, that gives a little bit more breathing room there. But of course, if you're like using container queries everywhere, you don't have this problem. You're probably adapting based contextually on where your component fits within the wider layout anyway.

So you're gonna get the benefits of that anyway. So I mean if you just wanna scrap using media queries in general on your website and just really go for it with container queries, that's gonna help with these kind of scenarios as well. So finally, oh not finally. Sixthly, that's a word I don't use much. Is it sixthly? I don't actually know if that's the right word.

Be careful when setting fixed length values. So you might have heard this idea of intrinsic web design before or intrinsic layout. So always let the content dictate the height of something basically. So if we come back to this example on the Disneyland Paris website, we can see how they must have set some kind of fixed height white background for their navigation bar.

And it's because of this fixed height, when the text gets bigger, that's why it's overflowing. So all we need to do in that scenario is just not set a fixed height. You can either just not set a height at all or if you really feel like you need to set a height, then set a minimum height so that the the kind of background still expands to accommodate that content.

Now, shout out to Ahmed Shadeed, who's been a speaker here in the past. He's done this fantastic website which you might have heard of called Defensive CSS. So rather than me going into all sorts of little CSS tips on how you could make sure your content is intrinsically being laid out, just check out this website. It's fantastic. It's got loads of different tips on how you can do this in lots of different scenarios.

It's really look really beautiful website. Do check it out. Now just a small issue as well. Just a really small issue. Just watch out for massive headings. Because like if you're in a situation where like you've got big text anyway, such as typically a heading, like that heading is probably already big enough of the kinds of people who need to increase their text scale. So if we're making it super massive, we're back in this scenario again where there's only enough room for say one word on a line or, well I'm quite lucky in this example.

I don't seem to have anything more than a eight letter word. Because otherwise, if were talking about anti disestablishmentarianism, then we'd have a bit of a problem here. So you know, you can see here how the body text is still fine. But headings, it's not good. So here's what you can do.

There's lots of different techniques. I think in the CSS working group we want to find out more, find more built in ways of doing this. But this is what we recommend. So think about using some kind of formula to reduce the scale at which stuff gets bigger when it's a heading. Oh, don't take your photos yet because check this out.

If we're using CSS functions, wink wink, new feature, then you can build this in. But basically the idea is due to clever maths, if you do font size multiplied by whatever rate you want to increase the font size by, multiplied by the environment variable for the preferred text scale, minus one, then plus one, that the math's magic means that, you can tell I don't like math's can you?

The math's magic means that we can reduce the scale at which something increases. So say we are setting our level one heading, I can use this function, or I can do it myself. I don't need to use a CSS function of course. I can just copy and paste this. But it, you know, if you do this, you can set the size you want by default to be say Free REM.

And then what it will do is, say you want it to only increase by half the rate of normal. So now if I do this, oh gosh, I've got to do math now. Instead of it being 16 times three for pixel value, now it's gonna be 16 times three times 0.5. So, or something like that.

So that's good. No, I got the math wrong then. Anyway, basically, it will just serve the rate at which it scales. And it works really well at this. So yeah, do check that out. Have a play around with it. And then finally, just be ready to opt in to text scaling. So as we already saw, Chrome already supports this.

And also very excitingly last month, the MDN team added a really lovely article on MDN about how to use the text scale features. So Estelle, put your hand up. Thank you so much for all your hard work on reviewing that as well. And also Chris is not here who who wrote it as well. Thank you for that.

This is what I mean. CSS Day is great. You just get to meet the people who do this stuff. Isn't it so cool? It is cool, isn't it? So, yeah. Oh, didn't forgot to change my slides. So yeah, do check that out on MDN. And that's it. I'm done. Thank you very much. So please fix your tech scaling.

Josh, please bring your your liquid beverage and come and sit on the seat of interrogation.

Thank you. This is why I was terrified. National

treasurer's You've got sit there because the camera wants to pick you up and try and look at the camera.

Great.

Okay. Lots of questions.

Oh, no.

Yeah. Does the text scale meta tag work with hard coded PX font sizes? The answer's yes, I assume.

No. Not? It won't work with hard coded pixel font sizes. So any absolute units you set, like pixels, they will still stay at that exact unit. Whereas if you use font relative ones, then it will scale up. So if you think back to the example I had earlier where we had like padding or margins or gaps, we didn't want them to get bigger. We we still wanted them to stay the same size. So that's why we needed to set those with the pixel values.

Okay. Thank you. Julian opines scathingly. Are you serious about pixels from margins and paddings?

Oh, is that controversial? I'm very serious about this. You should use well, generally, it's contextual, but you should use generally pixel values or your favorite absolute value. You can use inches if you want or centimeters, I don't mind. But yeah, try and set those with the fixed values.

I agree. I agree. And Julian said, loves the talk by

the way.

Okay. Vadim, the the glamorous Vadim McKeev over there by Estelle, works for MDN. Thanks, Vadim. Vadim says, what's the metatech scale REMS strategy for now while Safari and Firefox are not yet supporting it?

Well, great thing about this is you don't need to like you're you're not gonna have to do anything differently, hopefully, Like once those browsers start to support it. I mean right now you can still do all these techniques to test your website well to make sure that the text is scaling and looking good on smaller devices.

So all those techniques are the same. And then you can start using the metatag now and things should work. You should at least get the benefits on Chrome. So Android users will benefit. And then once hopefully Apple and Firefox start supporting it as well, happy days.

Jake, what's the ETA in Firefox? Maybe this year. Nice.

I mean, they only gave us like their actual standards approval officially like this week. So we'll see. We we were waiting for us to put it in the in the WhatWG HTML spec as well. So now there is a PR going out for that as well.

Nice. CSS working group. They rock. Even more now that you've joined. Okay. Matt Anne says, when setting the root font size, you said don't change it. But can we do, like, clamp 12 pixels to VW 24 pixels? Is that a good thing to do, or do you still advise not mucking about with the root forms?

You say that slowly?

I can. I can even

That's let you really helpful. Oh, yeah. Gosh. When someone reads out code, it's so difficult, isn't it? And your brain's taking it. No. So the problem well, maybe. So but oh gosh. Fluid typography is absolutely brilliant isn't it? So if you want to set like a kind of default font size like that where you change the root font size, then you can do the clamp but make sure you're not using pixel I don't know. Make sure you're not using pixel values to clamp it.

Try and use rem values instead because some users like to decrease their font size as well. And so if you're setting a minimum clamp of say 16 pixels, those users won't get the benefit of that anymore. They're like why can't I reduce the font size on your website? So you could look into it a bit more, do a bit of user research. But generally I would yeah advise caution with that approach. But, yes, fluid typography is great.

Excellent. Okay. This is a long and involved question. Oh, no. So I can pass you the phone. Okay. It's about to run out of battery, and the USB thing doesn't work anymore, so it's gonna die. Shep writes, why was it decided to separate the opt in rule into HTML and not keep it inside the stylesheet, e.

G. Like a new rule?

That's a really good question as well. And we I think we did consider that as well. The reason why it had to be in HTML in the end is because really, there's nothing really going on in CSS to prevent this kind of correct behavior from happening. It's just, so I guess if you imagine a theoretical world where we create a new thing to replace HTML, we're not gonna need to set this meta tag anymore to make sure the text scale works. We'd probably just make that the default behavior.

So it's not really a CSS problem going on here. It's a bit like the debate around like when we set the viewport meta tag, should that live in HTML? Should that exist in CSS? And historically, well it's only for historical reasons again that things have worked out that way, why a meta tag. But I think the other issue is we don't really have like a standard way in CSS of setting default values.

I mean I think it was Brahmas actually who suggested the idea of having some way of doing it in CSS. That probably was an option, but again, it's probably one of those things where unfortunately it needs to be a metatag. We did consider other options, but to get that initial font size set properly, it needs to live in HTML land, unfortunately.

It's also like when the viewport meta tag first came out, and friends of mine wrote an at viewport CSS rule. But the trouble is with that is that kind of information needs to be given to the browser really, really early because it can affect the layout quite comprehensively.

Or even stuff like now when you're, downloading images of the pic like, the picture element, stuff like that. Yeah.

Okay. Two questions that are really, really taxing. I'm sorry about this.

Good. Should've done a longer talk, shouldn't I?

Don't worry I I did warn you.

Yeah. You

did. They'll make you look like a chump probably. But somebody called Nat asks, custard creams or bourbon? Oh, don't think.

Well, guess who asked this one?

Yes. I said somebody called Nat.

Are you listening to me? Well, yeah. That's a very good point. Might be having Nat's in the room. So I am religious about bourbon biscuits, and custard cream biscuits in The UK are awful. They just start. Sorry. So, yeah, bourbon biscuits are better.

Loser. Alan asks, is Salford actually worth visiting? No. There you have it. Don't go Salford, but do give it up for Josh Tuma.

Thank you.

Let's fix the web's text size

Josh Tumath

.css-day {
  date: 'June 11 & 12 2026';
  location: 'Amsterdam'
}
#identifier-sponsors {
  Google
  AG Grid
}
selector-sponsors {
  9ELEMENTS
  Polypane
}
Photograph of Josh Tumath, a man with short hair smiling. Stylized 'CSS DAY' logo formed by rectangular blocks. Sponsor logos for Google, AG Grid, 9ELEMENTS (with an 'IX' symbol), and Polypane (with an icon resembling a browser tab).

AG Grid

AG Grid logo and an 'X' icon.

AG Grid

A slide showing the BBC logo.

BBC

The slide features a colorful gradient background.
Three BBC logos.

LET'S FIX THE WEB'S TEXT SIZE

BBC

A colorful gradient background.

Josh Tumath (he/him)

  • Senior Software Engineer
  • Web Design System, BBC
  • CSSWG Member

BBC

A headshot of Josh Tumath, a smiling man with short hair, wearing a light-colored t-shirt.

Two icons for social media: a blue butterfly representing Twitter/X, and a purple mastodon representing Mastodon.

The BBC logo.

Josh Tumath (he/him)

Senior Software Engineer

Web Design System, BBC

CSSWG Member

@joshtumath.uk

@joshtumath@mastodon.social

A smiling headshot of Josh Tumath. A butterfly logo for X/Twitter. A Mastodon logo. The BBC logo.

Josh Tumath (he/him)

  • Senior Software Engineer
  • Web Design System, BBC
  • CSSWG Member

@joshtumath.uk

@joshtumath@mastodon.social

Headshot of Josh Tumath, a smiling white man with short blonde hair.

A butterfly icon is next to the first link, and the Mastodon elephant icon is next to the second link.

The BBC logo is displayed.

Josh Tumath (he/him)

  • Senior Software Engineer
  • Web Design System, BBC
  • CSSWG Member

joshtumath.uk

@joshtumath@mastodon.social

BBC

A round profile picture shows a smiling man with short blonde hair and a grey t-shirt. A stylized blue butterfly icon is displayed. A blue Mastodon icon is displayed. The BBC logo is displayed.

World Wide Web Consortium (W3C) and CSS

Two logos are displayed side by side. On the left is the World Wide Web Consortium (W3C) logo, featuring a stylized blue 'W3' symbol encircled by the text 'WORLD WIDE WEB CONSORTIUM'. On the right is the CSS logo, a purple square with rounded corners containing the white text 'CSS'.

World Wide Web Consortium (W3C)

CSS

An image showing two logos: On the left, the circular blue and white W3C logo with "WORLD WIDE WEB CONSORTIUM" written around the perimeter and a stylized "W3" in the center. On the right, a purple rounded square logo with "CSS" written in white capital letters.

World Wide Web Consortium

CSS

Logo for the World Wide Web Consortium (W3C), featuring a stylized 'W3' symbol encircled by the words 'WORLD WIDE WEB CONSORTIUM'.

Logo for CSS (Cascading Style Sheets), featuring the letters 'CSS' in white on a purple rounded square background.

World Wide Web Consortium (W3C) and CSS

BBC @johnwalsh.uk

Two logos are displayed side by side. On the left, the circular World Wide Web Consortium (W3C) logo features the text "WORLD WIDE WEB CONSORTIUM" around a stylized W3C symbol. On the right, the CSS logo is a rounded purple square with "CSS" in white letters.

World Wide Web Consortium

CSS

Two logos are displayed: the World Wide Web Consortium (W3C) logo and the CSS logo.

World Wide Web Consortium (W3C)

CSS

Two logos are displayed side-by-side. On the left is the World Wide Web Consortium (W3C) logo, featuring an intertwined 'W3' symbol in blue, encircled by the text "WORLD WIDE WEB CONSORTIUM". On the right is the CSS logo, a rounded purple square with "CSS" in white capital letters.

World Wide Web Consortium (W3C)

CSS

Two logos are displayed: the World Wide Web Consortium (W3C) logo and the CSS logo.

World Wide Web Consortium (W3C)

CSS

Two logos are displayed side-by-side. On the left is the World Wide Web Consortium (W3C) logo, featuring a circular design with "WORLD WIDE WEB CONSORTIUM" text around a stylized W3C symbol. On the right is the CSS logo, which is the text "CSS" in white on a purple rounded square background.

World Wide Web Consortium (W3C)

CSS

Two logos are displayed side-by-side. On the left, the World Wide Web Consortium (W3C) logo, which is a circular design with 'WORLD WIDE WEB CONSORTIUM' written around a stylized 'W3' symbol. On the right, the CSS logo, which is a purple rounded square with 'CSS' in white letters.

CSS Fonts Module Level 5

W3C logo in the top right. Browser logos for Chrome, Firefox, Safari, and Edge with version numbers are shown at the bottom.

CSS Fonts Module Level 5

Editor's Draft, 9 January 2026

Table of Contents

  • 1 Introduction
    • 1.1 Value Definitions
  • 2 Text-Scale new element
    • 2.1 Keywords
    • 2.2 The legacy keyword
    • 2.3 The 'scale' keyword
  • 3 Basic Font Properties
    • 3.1 Font family: the 'font-family' property
    • 3.1.1 Generic font families
    • 3.2 Font weight: the 'font-weight' property
    • 3.3 Font style: the 'font-style' property
    • 3.4 Relative sizing: the 'font-size-adjust' property
  • 4 Font Resources
    • 4.1 The '@font-face' rule
    • 4.2 Font reference: the 'src' descriptor
    • 4.2.1 Parsing the 'src' descriptor
    • 4.3 Font property descriptors: the 'font-size'
    • 4.4 Glyph Size Multiplier: the 'size-adjust' descriptor
    • 4.5 Line Height Font Metrics Overrides: the 'ascent-override', 'descent-override', and 'line-gap-override' descriptors
  • 6 Superscript and subscript metrics overrides: the

More details about this document

Feedback:

  • CSSWG Issues Repository
  • Inline In Spec

Editor:

  • Chris Lilley (W3C)

Former Editor:

  • Myles C. Maxfield (formerly of Apple Inc.)

Suggest an Edit for this Spec:

  • GitHub Editor

Delta Spec:

  • yes

Test Suite:

Browser support:

  • Chrome 145
  • Firefox 147
  • Safari 26
  • Edge 144
A W3C logo is in the upper right corner. Below the test suite information, there are small icons representing Chrome, Firefox, Safari, and Edge browsers, each followed by a version number.

CSS Fonts Module Level 5

Editor's Draft, 9 January 2026

TABLE OF CONTENTS

  • 1 Introduction
    • 1.1 Value Definitions
  • 2 Text-Scale meta element
    • 2.1 Keywords
    • 2.2 The legacy keyword
    • 2.3 The 'scale' keyword
  • 3 Basic Font Properties
    • 3.1 Font family: the 'font-family' property
      • 3.1.1 Generic font families
    • 3.2 Font weight: the 'font-weight' property
    • 3.3 Font style: the 'font-style' property
    • 3.4 Relative sizing: the 'font-size-adjust' property
  • 4 Font Resources
    • 4.1 The '@font-face' rule
    • 4.2 Font reference: the 'src' descriptor
      • 4.2.1 Parsing the 'src' descriptor
    • 4.3 Font property descriptors: the 'font-size'
    • 4.4 Glyph Size Multiplier: the 'size-adjust' descriptor
    • 4.5 Line Height Font Metrics Overrides: the 'ascent-override', 'descent-override', and 'line-gap-override' descriptors
    • 4.6 Superscript and subscript metrics overrides: the

More details about this document

This version: https://drafts.csswg.org/css-fonts-5/

Latest published version: https://www.w3.org/TR/css-fonts-5/

Previous Versions: https://www.w3.org/TR/2021/WD-css-fonts-5-20211221/

Feedback:
CSSWG Issues Repository
Inline In Spec

Editor:
Chris Lilley (W3C)

Former Editor:
Myles C. Maxfield (Formerly of Apple Inc.)

Suggest an Edit for this Spec:
GitHub Editor

Delta Spec:
yes

Test Suite:
https://wpt.fyi/results/css/css-fonts/

  • Chrome 145
  • Firefox 147
  • Safari 26
  • Edge 144

W3C logo. Icons for browser compatibility showing Chrome 145, Firefox 147, Safari 26, and Edge 144.

The We

A BBC logo.

The Web Content Accessibility Guidelines 2.2 have these success criteria:

  • 1.4.4 Resize Text
  • 1.4.10 Reflow

The best practices that web developers should follow to support text resizing?

The best practices that web developers should follow to support text resizing?

  • Design your website 'mobile first' and follow responsive web design practices
.sidebar {
    display: grid;
    gap: 1rem;

    @media (min-width: 56.25rem) {
        grid-template-columns: 1fr 18.75rem;
    }
}

.headline {
    font-size: 2.5rem;

    @media (min-width: 37.5rem) {
        font-size: 3rem;
    }
}
A green checkmark icon precedes the first practice listed.

The best practices that web developers should follow to support text resizing?

  • Design your website 'mobile first' and follow responsive web design practices
.sidebar {
	display: grid;
	gap: 1rem;
	@media (min-width: 56.25rem) {
		grid-template-columns: 1fr 18.75rem;
	}
}
.headline {
	font-size: 2.5rem;
	@media (min-width: 37.5rem) {
		font-size: 3rem;
	}
}

The best practices that web developers should follow to support text resizing?

  • Design your website 'mobile first' and follow responsive web design practices
.sidebar {
	display: grid;
	gap: 1rem;

	@media (min-width: 56.25rem) {
		grid-template-columns: 1fr 18.75rem;
	}
}

.headline {
	font-size: 2.5rem;

	@media (min-width: 37.5rem) {
		font-size: 3rem;
	}
}
A CSS code example demonstrating responsive design with `rem` units for font-size and media queries for grid layout. The BBC logo is visible in the bottom left corner of the slide.

The best practices that web developers should follow to support text resizing?

  • Design your website 'mobile first' and follow responsive web design practices
.sidebar {
	display: grid;
	gap: 1rem;
}

@media (min-width: 56.25rem) {
	grid-template-columns: 1fr 18.75rem;
}

.headline {
	font-size: 2.5rem;
}

@media (min-width: 37.5rem) {
	font-size: 3rem;
}

The best practices that web developers should follow to support text resizing?

  • Design your website 'mobile first' and follow responsive web design practices
.sidebar {
    display: grid;
    gap: 1rem;
    @media (min-width: 56.25rem) {
        grid-template-columns: 1fr 18.75rem;
    }
}

.headline {
    font-size: 2.5rem;
    @media (min-width: 37.5rem) {
        font-size: 3rem;
    }
}

The best practices that web developers should follow to support text resizing?

  • Design your website 'mobile first' and follow responsive web design practices
.sidebar {
  display: grid;
  gap: 1rem;
}

@media (min-width: 56.25rem) {
  grid-template-columns: 1fr 18.75rem;
}
.headline {
  font-size: 2.5rem;
}

@media (min-width: 37.5rem) {
  font-size: 3rem;
}

The best practices that web developers should follow to support text resizing?

  • Design your website 'mobile first' and follow responsive web design practices
.sidebar {
	display: grid;
	gap: 1rem;
	@media (min-width: 56.25rem) {
		grid-template-columns: 1fr 18.75rem;
	}
}

.headline {
	font-size: 2.5rem;
	@media (min-width: 37.5rem) {
		font-size: 3rem;
	}
}
A small BBC logo is visible at the bottom left of the slide.

The best practices that web developers should follow to support text resizing?

  • Design your website 'mobile first' and follow responsive web design practices
.sidebar {
    display: grid;
    gap: 1rem;
}

@media (min-width: 56.25rem) {
    grid-template-columns: 1fr 18.75rem;
}

.headline {
    font-size: 2.5rem;
}

@media (min-width: 37.5rem) {
    font-size: 3rem;
}

The best practices that web developers should follow to support text resizing?

  • Design your website 'mobile first' and follow responsive web design practices
  • Size everything in font relative units like em and rem
.sidebar {
	display: grid;
	gap: 1rem;
}

@media (min-width: 56.25rem) {
	grid-template-columns: 1fr 18.75rem;
}
}

.headline {
	font-size: 2.5rem;
}

@media (min-width: 37.5rem) {
	font-size: 3rem;
}
}

The best practices that web developers should follow to support text resizing?

  • Design your website 'mobile first' and follow responsive web design practices
  • Size everything in font relative units like em and rem
  • Use rem or em units in media queries
.sidebar {
	display: grid;
	gap: 1rem;
}

@media (min-width: 56.25rem) {
	grid-template-columns: 1fr 18.75rem;
}

.headline {
	font-size: 2.5rem;
}

@media (min-width: 37.5rem) {
	font-size: 3rem;
}
A CSS code example demonstrating the use of rem units for sizing and in media queries.

Incoming complaint!

Two red alarm icons flank the text.

Increasing text size

Screenshot of a mobile news application displaying an article.

Increasing text size

The slide shows two smartphone screenshots connected by a right-facing arrow. The left screenshot displays a sports news article in a mobile app. The right screenshot shows an Android 'Display size and text' settings page with font size and display size controls.

Increasing text size

Three mobile phone screen mockups are arranged horizontally, connected by arrows. The first screen shows a news article in an app with standard text size. The middle screen displays a phone's display settings, highlighting a font size adjustment slider. The third screen shows the same news article from the app, but with a visibly larger text size, illustrating the result of increasing the font size in the settings.

What's the problem?

Three screenshots of a mobile phone. The left screenshot shows a BBC sports app with live reporting of a golf event. The middle screenshot shows the Android system settings for 'Display size and text', with the font size slider adjusted to a larger setting. The right screenshot shows the same BBC sports app as the left, but the text size remains unchanged, indicating an accessibility issue.

What's the problem?

A slide showing three mobile phone screenshots. The left and right screenshots display a BBC Sport app's live reporting page for a golf tournament. The middle screenshot shows a mobile device's display settings, with sliders for font size and display size set to 'bigger'. A large red 'FAIL' stamp is overlaid across the middle and right screenshots, visually indicating an accessibility failure where the text size in the app did not change despite the system settings adjustment.

What's the problem?

Screenshot of a mobile application interface, likely a BBC sports app, showing three views of a 'Live Reporting' page for 'The Open' golf tournament. The left and right views show the default text size, while the center view shows system 'Font size' and 'Display size' settings, overlaid with a large red 'FAIL' stamp, indicating the settings are not applied. The BBC logo and Twitter handle @johnwihlborg are at the bottom of the slide.

What's the problem?

Three mobile application screenshots, likely showing a BBC news article. The central screenshot displays system settings for 'Display size and text' with a font size slider. A large red 'FAIL' stamp is overlaid across the central and right screenshots.

What's the problem?

Web View

BBC @jameshollidge

Screenshot of a mobile application interface displaying a live sports reporting page for "The Open" golf tournament, with the label "Web View" next to it.

What's the problem?

Web View

Screenshot of the BBC Sport mobile application displaying live golf reporting content, including a summary and leaderboard for "The Open" tournament.

It's bad because...

About 37% of users change their text scale settings on Android and iOS

A pie chart is shown, divided into a larger gray section and a smaller blue section. The blue section represents 37%.

It's bad because...

About 37% of users change their text scale settings on Android and iOS

Source: https://appt.org/en/stats/font-size

A pie chart illustrating user text scale preferences. The blue segment, representing approximately 37% of the chart, indicates users who change their text scale, while the larger grey segment represents users who use the default text scale.

It's bad because...

About 37% of users change their text scale settings on Android and iOS

Source: https://appt.org/en/stats/font-size

BBC

A pie chart illustrating the percentage of users who change their text scale settings versus those who use the default. The chart shows approximately 37% change text scale (blue segment) and 63% use default text scale (grey segment).

It's bad because...

About 37% of users change their text scale settings on Android and iOS

Source: https://appt.org/en/stats/font-size

  • Change text scale
  • Use default text scale

A 3D pie chart illustrating user preferences for text scale settings. A blue slice represents 37% of users who change their text scale, and a larger gray slice represents 63% of users who use the default text scale.

“Why doesn’t it work? We followed all the best practices!”

“Why doesn’t it work? We followed all the best practices!”

BBC bbc.co.uk

It was all a lie

@joshtumath.uk

BBC logo in the bottom left corner.

It was all a lie

BBC @joshtumath.uk

It was all a lie

*well... not really, it's complicated

@joshtumath.uk

The BBC logo is in the bottom left corner.

It happens on all mobile web browsers

A screenshot of a mobile phone displaying the BBC Bitesize website in a web browser.

It happens on all mobile web browsers

The slide presents three mobile phone screenshots arranged horizontally with white arrows indicating a flow. The first and third screenshots show the BBC Bitesize website displayed in a mobile web browser. The middle screenshot shows the mobile device's system settings for 'Display size and text', which includes options to adjust font size and display size, along with a preview of app icons. The third screenshot of the BBC Bitesize website appears visually identical to the first.

Firefox kind of works... but it's zooming in, not making text bigger

Screenshot of the BBC Bitesize mobile website or application, showing sections like Primary, Secondary, Careers, and Teachers.

Firefox kind of works... but it's zooming in, not making text bigger

Screenshot of the BBC Bitesize mobile website displayed on a phone, showing categories like Primary, Secondary, Careers, and Teachers, with a BBC logo at the top.

Firefox kind of works... but it’s zooming in, not making text bigger

Three mobile phone screen screenshots arranged horizontally with large white arrows pointing right between them. The first screenshot shows the BBC Bitesize website in a mobile browser, displaying primary and secondary school sections and other content at a standard size. The second screenshot shows the Android system settings for "Display size and text," with sliders for "Font size" and "Display size." The third screenshot shows the BBC Bitesize website again in the same mobile browser, but all elements, including text, images, and the header, are magnified, indicating a full-page zoom effect rather than only increased text size.

Firefox kind of works... but it's zooming in, not making text bigger

A three-step diagram illustrates how Firefox handles text scaling. The first image shows a mobile screen displaying the BBC Bitesize website. An arrow points to the second image, which shows a mobile screen of 'Display size and text' settings, with options for 'Font size' and 'Display size'. A second arrow points to the third image, which shows the BBC Bitesize website again, but appearing zoomed in, indicating that the browser zoomed the entire page instead of only increasing text size.

On macOS, nothing happens

A screenshot showing a web browser displaying the BBC Bitesize website, connected by a white arrow to a screenshot of macOS System Settings showing the Text Size options with 'Example 24 pt' selected and a list of native applications.

On macOS, nothing happens

A series of screenshots demonstrating text scaling on macOS. The first screenshot on the left shows the BBC Bitesize website in a web browser. An arrow points from this to a central screenshot of the macOS System Settings, open to the Accessibility > Display > Text Size panel, showing 'Example 24 pt' as the default text size and options to apply it to various applications. A second arrow points from the System Settings panel to a third screenshot on the right, which shows the BBC Bitesize website appearing identical to the first screenshot, illustrating that increasing the text scale in macOS settings had no effect.

On Windows, the entire app zooms

Screenshot of a web browser displaying the BBC Bitesize website.

On Windows, the entire app zooms

A screenshot of the BBC Bitesize website in a web browser is shown next to a screenshot of the Windows 11 Accessibility settings, specifically the 'Text size' adjustment page, with an arrow pointing from the browser to the settings.

On Windows, the entire app zooms

A comparison of text scaling on Windows. The left image shows the BBC Bitesize website in a browser with standard text size. The middle image shows the Windows 11 Accessibility settings, specifically the "Text size" slider which is adjusted to a larger size. The right image shows the BBC Bitesize website again, but with all elements, including the browser's UI, scaled up to a significantly larger size, demonstrating the "entire app zooms" effect. White arrows connect the text size slider in the settings to the enlarged browser view.

But you can increase it on desktop browsers

But you can increase it on desktop browsers

BBC @joshtumath.uk

Browser Settings for Text Size and Zoom

Screenshots of Google Chrome settings, Mozilla Firefox preferences, and Apple Safari's View menu, all displaying options related to text size, zoom, and appearance.

Browser Font and Zoom Settings

Screenshots of browser user interfaces. The first image displays Google Chrome's 'Customise fonts' settings, showing options for font size, minimum font size, and standard/serif/sans-serif font selections. The second image shows Mozilla Firefox's 'General' settings page, highlighting the 'Fonts' section with default font and size options, and the 'Zoom' section with default zoom level. The third image shows Mozilla Firefox's 'View' menu, with options to customize the toolbar, show various sidebars, and adjust 'Actual Size' including making text bigger or smaller.

Can we fix it?

How can we fix it?

BBC @joshtumath.uk

[css-env][css-values] UAs inconsistent in how OS font settings affect the default font-size medium #10674

Screenshot of a GitHub issue page.

[css-env][css-values] UAs inconsistent in how OS font settings affect the default font-size medium #10674

Screenshot of a GitHub issue page with the title and recent progress updates visible.

[css-env][css-values] UAs inconsistent in how OS font settings affect the default font-size medium #10674

Screenshot of a GitHub issue page.

[css-env][css-values] UAs inconsistent in how OS font settings affect the default font-size medium #10674

JoshTumath opened on Aug 2, 2024 edited by JoshTumath

EDIT: Progress updates

2025-06-21

preferred-text-scale is confirmed as the name of the new environment variable.

We're proposing a new <meta> tag at #12380. In that issue, we'll also propose to retract the pen unit.

2025-05-22

CSSWG resolved to adopt:

  • An env(preferred-text-scale) variable, which returns a multiplier for the OS or UA text size scaling. e.g. if the user increases the font scale in their OS accessibility settings to 150%, the env() var returns 1.5. Authors can use it as a multiplier in a calc().
  • A <length> unit called pen, which returns a length multiplied by the preferred-text-scale. Authors can use it for...

Labels: Needs Edits, css-env-1, css-values-4

Projects:

  • CSSWG Agenda TPAC 2024
  • CSSWG January 2025 meeting
Screenshot of a GitHub issue page displaying an open issue about OS font settings affecting default font size, with progress updates.

What would happen if we just make browsers scale all web pages with the OS text scale now?

Firefox Settings: Font and Zoom Options

Screenshot of the Firefox browser settings page, showing the General section with Font and Zoom options. Two blue arrows highlight the "Zoom text only" checkbox and the font size dropdown menu, which is open and displaying various font sizes.

Firefox Settings

A screenshot of the Firefox web browser's settings page, displaying options for Fonts, Zoom, and Language. Two blue arrows point to the "Zoom text only" checkbox and the "Size" dropdown menu, which is open and shows font sizes from 10 to 48, with '32' highlighted.

Cascading Style Sheets

Screenshot of a Google search results page for 'css' displayed in a web browser, showing a definition of CSS, related images, and navigation options. An arrow points to the 'All' search filter.

Screenshot of Bluesky application

A screenshot of the Bluesky social media application interface within a web browser. The app's sidebar navigation is visible on the left, and a main content feed shows a post. A large blue arrow points to the 'Popular With Friends' tab in the application's top navigation bar. The post content includes text and an image of clothes drying on an outdoor rotary clothesline. The browser's address bar displays 'bsky.app'.

iPhone

Screenshot of a web browser displaying the Apple (United Kingdom) website homepage for iPhone 16, showing a truncated navigation bar.

Screenshot of LinkedIn Feed

A screenshot of a LinkedIn feed displayed in a web browser. The browser's address bar shows "www.linkedin.com/feed/". The LinkedIn navigation bar is visible at the top, showing icons and truncated text labels such as "Home", "Network", "Jobs", "Messaging", "Notifications", "Me", "For Business", and "Learning". A search bar with the text "Search" and an "in" logo is also present. Below the navigation, a post by "Miriam..." a "Web Developer..." is visible, celebrating a "Happy 30-month anniversary to Container Quer...". Two blue arrows point to the "in Search" area and the "Miriam..." post.

Screenshot of LinkedIn Feed

A screenshot of the LinkedIn website interface displayed within a browser window. The top section shows the LinkedIn logo, a search bar, and navigation items such as "Home", "Network", "Jobs", "Messaging", "Notifications", and "Me". Many of these navigation labels are truncated due to limited space. Below this, a feed item is visible, starting with "Miriam... 1st Web Developer..." which also shows truncated text. Two purple arrows are present: one points to the LinkedIn logo and search bar area, and the other points to the 'Miriam...' feed item.

LinkedIn Feed

A screenshot of the LinkedIn website, displaying the feed within a web browser. Two blue arrows point to the LinkedIn logo and search bar on the left, and a user's profile information ('Miriam... 1st Web Developer') on the right.

Screenshot of LinkedIn feed

A screenshot of the LinkedIn social media platform's feed, showing a user's profile, a truncated post, and navigation elements. Two blue arrows point to the search bar and the user's name/title in the feed.

Screenshot of the Disneyland Paris website

A screenshot of the Disneyland Paris website homepage, displayed in a web browser. It shows the main navigation bar with options like "Our 2 Parks" and "Places to stay", a large promotional banner for the 'Disney Music Festival' featuring various animated characters, and call-to-action buttons for 'Tickets' and 'Hotel + Tickets'.

Disneyland Paris Website Screenshot

A screenshot of the Disneyland Paris website homepage displayed in a web browser. The website's navigation bar shows elements such as "Our 2 Parks" and "Places to stay" with text overflowing and truncating onto a second line. Below the navigation, an illustration depicts various Disney characters like Timon, Daisy Duck, Miguel from Coco, and Mickey Mouse, with "Disney Music" text.

Strictly Come Dancing is back. Who's taking part in 2025?

www.bbc.co.uk/cbbc/quizzes/strictly-come-dancing-cast-reveal

Screenshot of a BBC webpage featuring a 'Trending' section. The main content shows an image of two smiling women, both appearing to have Down Syndrome, in front of a blue background with radiating patterns, illustrating an article about 'Strictly Come Dancing'. Below the article, smaller thumbnail images depict a cartoon bear and Shaun the Sheep.

Our websites are not ready to support text scaling

@joshtumath.uk

BBC logo.

Our websites are not ready to support text scaling

BBC @joshtumath.uk

Our websites are not ready to support text scaling

BBC @joshtumath.uk

Small BBC logo.

If we're going to fix this, we need to opt-in

If we're going to fix this, we need to opt-in

BBC @joshtumath.uk

If we're going to fix this, we need to opt-in

@joshtumath.uk

A proposal to the CSSWG with David Grogan and Phil Rogers from the Google Chrome team

env(preferred-text-scale)

To get the user's text scale preference

BBC @joshtumath.uk

Screenshot of a technical explainer document titled "Explainer: env(preferred-text-scale)", displaying its authors and a hierarchical table of contents.

A proposal to the CSSWG with David Grogan and Phil Rogers from the Google Chrome team

env(preferred-text-scale)

To get the user's text scale preference

BBC @joshtumath.uk

Explainer: env(preferred-text-scale)

Authors

  • David Grogan (@dgrogan), Google
  • Josh Tumath (@joshtumath), BBC
  • Phil Rogers (@progers), Google
  • Ian Kilpatrick (@iskpat), Google

Table of contents

  • Introduction
  • Background
  • Existing user controls to scale content
    • Browser zoom
      • Firefox on Android - global zoom slider labelled as "Font Size"
      • Chrome on Android - per-site zoom slider
      • Safari on iOS - per-site zoom buttons
      • Authors can influence browser zoom
      • How authors detect and respond to browser zoom
    • Visual zoom (pinch-to-zoom)
      • How authors detect and respond to visual zoom
    • UI-level font setting
      • Firefox on desktop OSs
      • Chrome and Edge on desktop OSs
      • Safari on macOS
      • Mobile browsers
      • How authors detect and respond to UI-level font setting
    • OS-level font setting
      • Safari on iOS - no effect on sites
      • Chrome on Android - usually no effect
      • macOS - no effect
      • Windows 11
      • How authors detect and respond to OS-level font setting
  • Proposal
  • Prefers text scale
The slide presents a proposal for a new CSS environment variable, with a title and brief explanation on the left, and a detailed outline of an "Explainer" document on the right, listing authors and a comprehensive table of contents.

A proposal to the CSSWG with David Grogan and Phil Rogers from the Google Chrome team

env(preferred-text-scale)

To get the user's text scale preference

@joshtumwith.uk

Screenshot of a technical document titled "Explainer: env(preferred-text-scale)", which lists authors and a table of contents.

How preferred-text-scale is calculated

  • Default text scale where env(preferred-text-scale) = 1
  • Example text scaled to 15 pt
  • Example text scaled to 24 pt
Screenshot of a user interface element showing a text scaling slider. Three states of the slider are depicted, demonstrating how example text changes from a default size to 15 pt, and then to 24 pt.

How preferred-text-scale is calculated

When the text scale slider is set to Default, the example text displays normally. The environment variable for preferred text scale is env(preferred-text-scale) = 1.

When the text scale slider is increased, the example text displays at 15 pt. The environment variable for preferred text scale is env(preferred-text-scale) = 1.25.

When the text scale slider is further increased, the example text displays at 24 pt.

Screenshot showing three states of a mobile device's text accessibility settings. Each state includes a partial view of a settings menu with options like Wi-Fi and Bluetooth, a text size slider with 'A' on both ends and 'Default' in the middle, and three toggle switches. The top example shows the slider at 'Default' with normal 'Example' text. The middle example shows the slider increased, resulting in 'Example 15 pt' text. The bottom example shows the slider further increased, resulting in 'Example 24 pt' text.

How preferred-text-scale is calculated

With default text scale settings, the example text shows as "Example" and env(preferred-text-scale) = 1.

With increased text scale settings, the example text shows as "Example 15 pt" and env(preferred-text-scale) = 1.25.

With further increased text scale settings, the example text shows as "Example 24 pt" and env(preferred-text-scale) = 2.

The slide shows three rows, each depicting a user interface screenshot with a text size slider and an example text. The first row shows the slider at the default position, with 'Example' text. The second row shows the slider moved to the right, with 'Example 15 pt' text. The third row shows the slider moved further to the right, with 'Example 24 pt' text. Next to each UI example, the corresponding value of 'env(preferred-text-scale)' is listed.

How to use preferred-text-scale

.button {
	font-size: calc(16px * env(preferred-text-scale));
}

A second proposal to the CSSWG

1pem

A second proposal to the CSSWG

1pem

BBC @joshturnmath.uk

A second proposal to the CSSWG

FAIL: 1pem

BBC @joshtummath.uk

A red rubber stamp graphic with the word 'FAIL' is prominently displayed, appearing to stamp over the text '1pem'.

A third proposal to the CSSWG

<meta name=text-scale content=scale>

To change the page's default font size to the user preference

Explainer: meta tag for text scaling behavior

A slide showing a presentation on the left and a screenshot of a web document on the right. The web document is titled 'Explainer: meta tag for text scaling behavior' and displays authors and a table of contents.

So in summary...

BBC

A BBC logo is displayed.

The opt-in

A new HTML metadata tag

<meta name="text-scale" content="scale">

Or to opt-in more selectively

A new environment variable

env(preferred-text-scale)

Or to opt-in more selectively

A new environment variable

env(preferred-text-scale)

BBC @joshtumath.uk

The BBC logo is displayed in the bottom left corner of the slide.

Or to opt-in more selectively

A new environment variable

env(preferred-text-scale)

d-in with the
just works

es their text scale setting

<meta name="text-scale"...
<style>
  h1 {
  font-size: 2rem;

A UI component showing a horizontal slider with an 'A' icon at the start, labeled "Default" and "Example 24", illustrating text scaling. An arrow points from the right edge of the slide to "2rem" in the CSS code.

What happens to rem and em in media queries

Does it matter?

Medium: ⬅ 16px

What happens to rem and em in media queries? And why does it matter?

:root {
	font-size: medium;
}

.box {
	height: 1rem;
}

@media (min-width: 10rem) {
	/* ... */
}

Annotation for font-size: medium;: points to 16px (default font size).

Annotation for height: 1rem;: points to 16px.

Annotation for @media (min-width: 10rem): points to 160px.

What happens to rem and em in media queries? And why does it matter?

:root {
	font-size: medium;
}

.box {
	height: 1rem;
}

@media (min-width: 10rem) {
	/* ... */
}

Explanation of values:

  • The font-size: medium; in the :root selector corresponds to 16px, which is noted as the default font size.
  • A height: 1rem; set for .box also corresponds to 16px.
  • A media query with min-width: 10rem; corresponds to 160px.

What happens to rem and em in media queries? And why does it matter?

:root {
	font-size: medium;
}

medium resolves to 16px (default font size).

.box {
	height: 1rem;
}

1rem resolves to 16px.

@media (min-width: 10rem) {
	/* ... */
}

10rem resolves to 160px.

@joshtumath.uk

CSS code snippets illustrating how rem and em units resolve to pixel values within `:root` styles, element heights, and media queries. An arrow points from `medium` to `16px` with the label "default font size". Another arrow points from `1rem` to `16px`. A third arrow points from `10rem` in a media query to `160px`. The BBC logo is visible at the bottom left of the slide.

What happens to rem and em in media queries? And why does it matter?

:root {
    font-size: medium;
}

This means 16px (default font size)

.box {
    height: 1rem;
}

This means 16px

@media (min-width: 10rem) {
    /* ... */
}

This means 160px

What happens to rem and em in media queries? And why does it matter?

:root {
	font-size: medium;
}

.box {
	height: 1rem;
}

@media (min-width: 10rem) {
	/* ... */
}

In the CSS code example:

  • The :root font-size of medium is equivalent to 16px (the default font size).
  • A .box with height: 1rem; is equivalent to 16px.
  • A media query with min-width: 10rem is equivalent to 160px.

What happens to rem and em in media queries? And why does it matter?

:root {
  font-size: medium;
}

.box {
  height: 1rem;
}

@media (min-width: 10rem) {
  /* ... */
}
  • The root font size set to medium equates to 16 pixels (default).
  • 1rem resolves to 16 pixels for the box height.
  • 10rem in the media query resolves to 160 pixels for the minimum width.
:root {
  font-size: 20px;
}

.box {
  height: 1rem;
}

@media (min-width: 10rem) {
  /* ... */
}
  • The :root `font-size` is explicitly set to 20px.
Two side-by-side CSS code examples demonstrate `rem` unit calculations. The left example shows default browser behavior: blue arrows indicate that a root font size of `medium` (16px) makes `1rem` equal to 16px and `10rem` in a media query equal to 160px. The right example shows the `font-size: 20px;` in the `:root` selector, highlighted in red, indicating a change to the base `rem` unit value.

What happens to rem and em in media queries? And why does it matter?

The slide presents two CSS code examples to illustrate the behavior of rem units. The left example demonstrates rem calculations with a default root font size:

:root {
	font-size: medium; /* <-- 16px (default font size) */
}

.box {
	height: 1rem; /* <-- 16px */
}

@media (min-width: 10rem) { /* <-- 160px */
	/* ... */
}

This code shows that with a default root font size of 16 pixels, 1rem translates to 16 pixels, and 10rem in a media query evaluates to 160 pixels.

The right example shows the same CSS structure but with an explicit root font size:

:root {
	font-size: 20px;
}

.box {
	height: 1rem;
}

@media (min-width: 10rem) {
	/* ... */
}

In this scenario, if the :root font size is changed to 20 pixels, all rem values would be recalculated based on this new root font size. For instance, 1rem would become 20 pixels, and 10rem in the media query would become 200 pixels.

BBC @joshtumath.uk

The slide features two side-by-side CSS code blocks. The left code block includes annotated arrows indicating the pixel equivalent for rem values, such as '16px (default font size)' and '160px'.

What happens to rem and em in media queries? And why does it matter?

:root {
	font-size: medium;
}

.box {
	height: 1rem;
}

@media (min-width: 10rem) {
	/* ... */
}

Annotations for the left code example:

  • Next to font-size: medium; an arrow indicates it evaluates to 16px (default font size).
  • Next to height: 1rem; an arrow indicates it evaluates to 16px.
  • Next to (min-width: 10rem) an arrow indicates it evaluates to 160px.
:root {
	font-size: 20px;
}

.box {
	height: 1rem;
}

@media (min-width: 10rem) {
	/* ... */
}

Annotations for the right code example:

  • Next to height: 1rem; an arrow indicates it evaluates to 20px.

Two CSS code examples are displayed side-by-side, each with accompanying arrows and pixel values illustrating the computed size of rem units in different contexts.

ens to rem and em in media queries?

oes it matter?

medium; ← 16px (default font size)

:root {
  font-size: 20px;
}

.box {
  ...
}

What happens to rem and em in media queries? And why does it matter?

Example 1: Default Root Font Size

:root {
	font-size: medium;
}

.box {
	height: 1rem;
}

@media (min-width: 10rem) {
	/* ... */
}
  • :root font-size: medium; evaluates to 16px (default font size)
  • .box height: 1rem; evaluates to 16px
  • Media query (min-width: 10rem) evaluates to 160px

Example 2: Custom Root Font Size

:root {
	font-size: 20px;
}

.box {
	height: 1rem;
}

@media (min-width: 10rem) {
	/* ... */
}
  • :root font-size: 20px;
  • .box height: 1rem; evaluates to 20px
  • Media query (min-width: 10rem) evaluates to 160px

joshtumath.uk

What happens to rem and em in media queries? And why does it matter?

:root {
  font-size: medium;
}

.box {
  height: 1rem;
}

@media (min-width: 10rem) {
  /* ... */
}

Annotation for font-size: medium;: 16px (default font size)

Annotation for height: 1rem;: 16px

Annotation for @media (min-width: 10rem) {: 160px

:root {
  font-size: 20px;
}

.box {
  height: 1rem;
}

@media (min-width: 10rem) {
  /* ... */
}

Annotation for height: 1rem;: 20px

Annotation for @media (min-width: 10rem) {: 160px

BBC @joshtumath.uk

A slide illustrating the behavior of rem units in CSS, especially within media queries. It presents two columns of CSS. The left column shows a :root font-size of medium (16px), where 1rem is 16px and a min-width: 10rem media query evaluates to 160px. The right column shows :root font-size explicitly set to 20px, making 1rem equal to 20px for element heights. However, the min-width: 10rem media query still evaluates to 160px, demonstrating that media queries use the *initial* root font size (typically 16px) for rem calculations, independent of any subsequent :root font-size declarations.

What happens to rem and em in media queries? And why does it matter?

:root {
  font-size: medium;
}

.box {
  height: 1rem;
}

@media (min-width: 10rem) {
  /* ... */
}

On the left, annotations show: font-size: medium; evaluates to 16px (the default font size). For .box, height: 1rem; evaluates to 16px. For the media query, min-width: 10rem evaluates to 160px.

:root {
  font-size: 20px;
}

.box {
  height: 1rem;
}

@media (min-width: 10rem) {
  /* ... */
}

On the right, annotations show: font-size: 20px; in :root sets the root font size to 20px. For .box, height: 1rem; evaluates to 20px. For the media query, min-width: 10rem evaluates to 160px.

What happens to rem and em in media queries? And why does it matter?

Left example:

:root {
	font-size: medium;
}

.box {
	height: 1rem;
}

@media (min-width: 10rem) {
	/* ... */
}

In the left example, where :root font-size is medium:

  • The :root font-size resolves to 16px (default font size).
  • The .box height of 1rem resolves to 16px.
  • The @media (min-width: 10rem) condition resolves to 160px.

Right example:

:root {
	font-size: 20px;
}

.box {
	height: 1rem;
}

@media (min-width: 10rem) {
	/* ... */
}

In the right example, where :root font-size is 20px:

  • The :root font-size resolves to 20px.
  • The .box height of 1rem resolves to 20px.
  • The @media (min-width: 10rem) condition resolves to 160px.

Relative length units in media queries are based on the initial value, which means that units are never based on results of declarations.

For example, in HTML, the em unit is relative to the initial value of font-size, defined by the user agent or the user's preferences, not any styling on the page.

Media Queries specification

Relative length units in media queries are based on the initial value, which means that units are never based on the results of declarations. For example, in HTML, the EM unit is relative to the initial value of the font size defined by the user agent or the user's preference, not any styling on the page.

An emoji of a yellow crying face, partially visible on the left side of the slide.

Relative length units (e.g., ems or rems) are based on the initial value, which are never based on results of author declarations.

For example, in <html>, font-size is relative to the initial value of font-size defined by the user agent or the user's preferences, not any author declarations.

Media Queries specification

A yellow emoji face with large blue tears crying profusely is overlaid on the center of the text.

Browser support for <meta name="color-scheme">

Limited availability

An infinity symbol icon is displayed next to the text "Limited availability". Below this, a horizontal graphic illustrates browser compatibility. Google Chrome and Microsoft Edge icons each have a green checkmark, indicating support. Firefox and Apple Safari icons each have an orange 'x' mark, indicating no support.

meta name=text-scale

<meta name="text-scale" content="scale" />

<style>
  h1 {
    font-size: 2.25em;
  }
</style>
A slide showing the `meta name=text-scale` feature. On the left, browser compatibility icons indicate support for the feature: Chrome (version 146), Edge (version 146), Opera, and Vivaldi show support. Firefox and Safari are marked with an 'X', indicating no support. On the right, a code snippet shows the `<meta name="text-scale" content="scale" />` tag and a CSS rule setting `h1` `font-size` to `2.25em`.

What's new in Web UI

Chrome for Developers

#GoogleIO

meta name=text-scale

<meta name="text-scale" content="scale()">
<style>
  h1 {
    font-size: 2.3em;
  }
  ...
</style>

A row of six circular icons representing browser compatibility, including Chrome, Edge, Firefox, and Safari. An embedded video demonstration shows a man in a black t-shirt with a white dinosaur logo speaking, positioned next to a code editor displaying HTML and CSS code related to text scaling.

How to test text scaling

BBC @joshhmath.uk

How to test text scaling

BBC @joshtumath.uk

The Web Content Accessibility Guidelines 2.2 have these success criteria:

  • 1.4.4 Resize Text
  • 1.4.10 Reflow
The Web Content Accessibility Guidelines 2.2 have these success criteria:

1.4.4 Resize Text

A blue arrow points to the text "1.4.4 Resize Text".

The Web Content Accessibility Guidelines 2.2 have these success criteria:

  • 1.4.4 Resize Text
  • 1.4.10 Reflow

We can do better!

A blue arrow points from the text "We can do better!" to the success criterion "1.4.4 Resize Text".

Maximum Text Size Increase by Operating System

  • Android (Pixel): 200%
  • iOS and iPadOS: ~310%
  • Windows: 225%
  • macOS: (highest increase)
A bar chart comparing the maximum text size increase across different operating systems: Android (Pixel), iOS and iPadOS, Windows, and macOS. macOS shows the highest increase, followed by iOS and iPadOS, then Windows, and Android (Pixel) shows the lowest increase. A partially visible table to the right lists the same operating systems.

We can test on desktop browsers

BBC @joshtumath.uk

A green checkmark icon.

BBC logo.

Testing text scaling
On Chrome and Edge desktop

Drag the 'Font size'

Two browser logos are shown: Chrome and Microsoft Edge. A screenshot of a browser's "Customise fonts" settings page displays a "Font size" slider (ranging from Tiny to Huge) and a "Minimum font size" slider. Below these are dropdowns for "Standard font", "Serif font", and "Sans-serif font". An arrow points to the "Font size" slider.

Testing text scaling On Firefox desktop

A Firefox browser logo is on the left. A screenshot of the Firefox desktop browser settings interface is displayed, showing sections for 'Fonts' and 'Zoom'. A blue arrow and text 'Enable 'zoom text only'' point to the 'Zoom text only' checkbox within the settings.

Testing text scaling

On Safari desktop

Press ⌥ ⌘ and + or -

A Safari application icon. A screenshot of the Safari desktop browser's 'View' menu, with an arrow pointing to the 'Make Text Bigger' and 'Make Text Smaller' options.

Testing text scaling On Safari desktop

Press ⌘ and + or -

@joshturnsth.uk

A screenshot shows the Safari desktop browser. A dropdown menu from the 'View' option is open, highlighting options like 'Make Text Bigger', 'Make Text Smaller', and 'Text Scaling'. The BBC logo is also visible on the slide.

Imagine a mobile user

  • Scale the text to 200%
  • Set the viewport to 320px width
  • Is the content readable?
  • Does the content overflow the viewport horizontally?

BBC @joshtumath.uk

Screenshot of the BBC Weather website in a mobile browser view, showing a UK weather summary with today's low temperature of 13 degrees and a cloud with rain icon.

  • Text to 200%
  • Viewport to 320px width
  • Is it readable?
  • Does content overflow the viewport?
  • oshtumath.uk
Screenshot showing a partial view of a webpage within a narrow viewport, likely from oshtumath.uk, demonstrating content at 200% text zoom and a 320px viewport width. Visible text on the webpage includes "UK", "Too", and "Ho".

BBC News

Screenshot of the BBC News website.

Mobile User

  • 200% text scaling
  • at 320px width
  • Can you still see the content?
  • Is the content still in flow?
Screenshot of the BBC Weather website displayed in a web browser's responsive design mode set to 320x667 pixels with a Device Pixel Ratio of 2 and an iPhone user agent. The browser tab shows "BBC Weather - Home". The website's header, containing a circular 'J' icon, a bell icon, 'B B C' text, and a hamburger menu, is visible. The large 'WEATHER' text is partially cut off and overlapping the hamburger menu, illustrating layout issues at this narrow mobile viewport and 200% text scaling.

Imagine a mobile user

  • Scale the text to 200%
  • Set the viewport to 320px width

Is the content readable?

Does the content overflow the viewport horizontally?

A screenshot of the BBC Weather website viewed within a mobile emulator, likely from browser developer tools. The website content shows a BBC logo, a menu icon, a large "WEATHER" heading, "UK Summary", "Today", "Home M5 Edit?", and a weather forecast with a cloud icon and "Low 13°". The BBC logo and the "WEATHER" heading appear to be overflowing or overlapping the container due to the narrow viewport and large text scaling.

Let's fix our websites' text scaling

BBC @joshtumath.uk

Let's fix our websites' text scaling

@joshtumath.uk
A BBC logo is in the bottom left corner of the slide.

1. Design your website ‘mobile and scaled up first’

BBC

BBC logo.

1. Design your website 'mobile and scaled up first'

A small BBC logo is displayed in the bottom left corner of the slide.

1. Design your website ‘mobile and scaled up first’

BBC

Textgröße

Screenshot of an iPhone displaying its "Text Size" accessibility settings, held in a person's hand.

Textgröße

A hand holds a smartphone, displaying accessibility settings for text size adjustment on its screen.

Textgröße

Screenshot of a mobile phone showing text size settings, with a slider to adjust the text size.

Textgröße

A hand holding a smartphone displays a settings screen for 'Textgröße' (Text Size), featuring a slider to adjust the text scale.

Textgröße

A close-up screenshot of a hand holding a smartphone, displaying the text size settings interface in German. The screen shows a title "Textgröße" (Text Size), a description about apps adapting to the set reading size, and a slider to adjust text size, along with an option for more accessibility settings.

2. Don't change the default font size

Don't change the default font-size

:root {
	font-size: 10px;
}
:root {
	font-size: 62.5%; /* = 10px */
}
:root {
	font-size: 16px;
}
:root {}

BBC @joshturnerh.uk

The slide shows four CSS code snippets demonstrating ways to set the root font size, with accompanying emojis indicating approval or disapproval. Three snippets show `:root { font-size: 10px; }`, `:root { font-size: 62.5%; /* = 10px */ }`, and `:root { font-size: 16px; }`, all marked with a thumbs-down emoji. The snippet `:root {}` is marked with a thumbs-up emoji.
An illustration of a yellow thumbs-down emoji next to the first code example.

3. Be careful using px units for layouts

Use rem units in media queries

.layout-sidebar {
	display: grid;
}

@media (width >= 900px) {
	grid-template-columns: 1fr 320px;
}

Game moves in favour of cats in Pet Roomba Wrestling

Onward journeys

Lorem ipsum dolor sit amet, consectetur adipiscing elit

Lorem ipsum dolor sit amet, consectetur adipiscing elit

Scores

Team Score Team
Cats-on-Trent 5 - 2 Dogshire County

BBC

@joshtumath.uk

Screenshot of a code editor showing CSS for a `.layout-sidebar` with `display: grid;` and a media query that applies `grid-template-columns: 1fr 320px;` for widths 900px or greater.

A simulated web page or news article layout featuring a main heading "Game moves in favour of cats in Pet Roomba Wrestling".

A large image of a white cat lying on a white robot vacuum cleaner.

In a sidebar, there are two smaller images, each showing a white cat lying on a white robot vacuum cleaner, accompanied by placeholder text.

A "Scores" section displays a table showing "Cats-on-Trent" with a score of "5 - 2" against "Dogshire County".

Use rem units in media queries

.layout-sidebar {
	display: grid;
}

@media (width >= 900px) {
	.layout-sidebar {
		grid-template-columns: 1fr 320px;
	}
}

Game moves in favour of cats in Pet Roomba Wrestling

Lorem ipsum dolor sit amet, consectetur adipiscing elit

Scores

Cats-on-Trent5-2Dogshire County

Onward journeys

Lorem ipsum dolor sit amet, consectetur adipiscing elit

Lorem ipsum dolor sit amet, consectetur adipiscing elit

Screenshot of a web page demonstrating a layout. The main content area features a headline, a large image of a cat riding a robot vacuum cleaner, and placeholder text. Below this is a "Scores" box showing "Cats-on-Trent 5-2 Dogshire County". A sidebar or related content section titled "Onward journeys" contains two smaller preview articles, each with an image of a cat on a robot vacuum cleaner and placeholder text.

Use rem units in media queries

.layout-sidebar {
	display: grid;
}

@media (width >= 900px) {
	grid-template-columns: 1fr 320px;
}

Game moves in favour of cats in Pet Roomba Wrestling

Onward journeys

Lorem ipsum dolor sit amet, consectetur adipiscing elit

Lorem ipsum dolor sit amet, consectetur adipiscing elit

Scores

Cats-on-Trent 5 - 2 Dogshire County

Screenshot of CSS code showing a `.layout-sidebar` class with `display: grid` and a media query for widths greater than or equal to 900 pixels, setting `grid-template-columns` to `1fr 320px`. Image of a fluffy white cat lying on a white robot vacuum cleaner (Roomba). Two smaller images, identical to the main cat on Roomba image, each with a placeholder caption 'Lorem ipsum dolor sit amet, consectetur adipiscing elit'. A scoreboard showing 'Cats-on-Trent 5 - 2 Dogshire County' below a 'Scores' heading.

Use rem units in media queries

.layout-sidebar {
	display: grid;
}

@media (width >= 56.25rem) {
	grid-template-columns: 1fr 20rem;
}

BBC @joshtumath.uk

Game moves in favour of cats in Pet Roomba Wrestling

Scores

A blue arrow points to "56.25rem" within the media query condition in the CSS code block. An image shows a fluffy white and grey cat with green eyes sitting calmly on top of a white circular robotic vacuum cleaner.

4. Only use px units for spacing

A small BBC logo is in the bottom left corner.

Use relative or proportional units for sizing text and maybe icons

e.g. rem, em, ch, fr, vh, % units

  • width
  • height
  • flex-basis
  • grid-template
  • font-size
  • background-size
  • etc...

BBC @joshtumath.uk

Screenshot of a BBC news webpage displaying 'Trending' articles. The page shows several article cards with images, such as a person laughing, two people smiling, and a diver with a shark, accompanied by headlines like 'Strictly Come Dancing is back!' and 'QUIZ: Shark bites - Deadly with Steve'.

Use relative or proportional units for sizing text and maybe icons

e.g. rem, em, ch, fr, vh, % units

  • width
  • height
  • flex-basis
  • grid-template
  • font-size
  • background-size
  • etc...

BBC @joshtumath.uk

A screenshot of a web browser displaying the "Trending" section of the BBC website. It shows several news articles with images, including one titled "Strictly Come Dancing is back! Who's taking part in 2025?" and another "QUIZ: Shark bites - Deadly with Steve".

Relative or proportional units for sizing text & icons

  • em, ch, fr, vh, % units
  • width
  • height
  • basis
A partial screenshot of a web browser displaying a BBC Children's quiz page. The URL visible in the address bar is www.bbc.co.uk/cbbc/quizzes/deadly-with-steve-shark-bites-facts-quiz. The page content shows "Trending" as a heading and several image thumbnails, including two smiling girls and a shark.

...te length units for spacing

  • ...s
  • ...p
  • ...gin
  • ...ing
  • ...
Screenshot of a BBC Children's website showing a 'Trending' section with articles about 'Strictly Come Dancing' and a shark quiz. The browser window displays its address bar and navigation controls, illustrating web content layout and spacing.

Use absolute length units for spacing

e.g. px units

  • gap
  • margin
  • padding
  • etc...

BBC @joshtumath.uk

Screenshot of a web browser displaying a BBC webpage, specifically a "Trending" section. The content includes two prominent news cards, one titled "Strictly Come Dancing is back!" with an image of two women, and another titled "QUIZ: Shark bites - Deadly with Steve" featuring a shark and a diver. Below these are smaller content previews, one of which displays "CREATIVE LAB".

5. Only use single column layouts on very small viewports

BBC

5. Only use single column layouts on very small viewports

A small BBC logo is displayed at the bottom of the slide.

Switch to a single column layout at ≈300px viewport width

Wales

Lough Erne eel conserv ation work could help save endange

Wales

Lough Erne eel conservation work could help save endangered species

A screenshot of a webpage layout demonstrating content cards. On the right, two distinct content cards are shown side-by-side. The left card displays a small image of a man in a cap, a Welsh flag icon, and a truncated headline about Lough Erne eel conservation. The right card features a larger image of the same man by a river, a Welsh flag icon, and the full headline: "Lough Erne eel conservation work could help save endangered species."

Switch to a single column layout at ≈300px viewport width

Comparison of a content card at different viewport widths:

Narrow Viewport Example (Left Card):

  • Location tag: Wales
  • Headline: Lough Erne eel conservation work could help save endangered species (text is highly line-wrapped due to narrow width)
  • Partial location tag: North...
  • Partial text visible near a map pin: Find your

Wider Single Column Layout Example (Right Card):

  • Location tag: Wales
  • Headline: Lough Erne eel conservation work could help save endangered species (text is less line-wrapped)
  • Location tag: Northern Ireland

Two side-by-side screenshots demonstrating responsive layout for a content card, likely a news "promo."

The left screenshot depicts a narrow mobile viewport. The content card features a small, square image of a man in a cap next to highly line-wrapped text describing "Lough Erne eel conservation work." Location tags "Wales" and a truncated "North..." are present. Below this, a single red map pin icon is partially visible next to truncated text.

The right screenshot depicts a wider, single-column mobile viewport. The same content card is displayed with a larger, wider rectangular image of the man. The text, "Lough Erne eel conservation work could help save endangered species," is less line-wrapped and more readable. Location tags "Wales" and "Northern Ireland" are present. Below this, a cluster of red map pin icons is shown.

Switch to a single column layout at ≈300px viewport width

Screenshot showing two news card components designed for a narrow viewport, each displaying an image of a man next to vertically wrapped text. The layout demonstrates the challenge of fitting content within a single column at approximately 300 pixels viewport width.

Switch to a single column layout at ≈300px viewport width

Very narrow layout example:

Wales

Lough Erne eel conservation work could help save endangered species

North...

Find your

Single column layout example:

Wales

Lough Erne eel conservation work could help save endangered species

Northern Ireland

Two comparison examples of a content card demonstrating responsive layout. The left example shows the card in a very narrow viewport, with an image of a man and text severely line-wrapped into single words or short fragments, alongside other text "North..." and "Find your" with map pin icons. The right example shows the same card content, including the image of the man and the full text, "Lough Erne eel conservation work could help save endangered species," along with "Northern Ireland" and map pin icons, rendered clearly in a single-column layout at a wider viewport.

Switch to a single column layout at ≈300px viewport width

Narrow Viewport Example:

Wales

Lough Erne eel conserv
ation work
could help
save
endange
red
species

North...

Find your

Single Column Layout Example:

Wales

Lough Erne eel conservation work could help save endangered species

Northern Ireland

Two side-by-side mobile interface screenshots demonstrating a responsive layout change.

The left screenshot shows a narrow interface where a news article title, "Lough Erne eel conservation work could help save endangered species," is severely line-broken and occupies many lines due to a constricted viewport. It includes a small profile image of a man in a cap, and map pin icons with truncated location text "North..." and a separate "Find your" text below.

The right screenshot shows the same content in a single-column layout, where the article title is fully displayed without awkward line breaks. It includes the same profile image of the man and map pin icons with "Northern Ireland" as the location text, illustrating improved readability and layout at a wider or adjusted viewport width.

Switch to a single column layout at ≈300px viewport width

🏴󠁧󠁢󠁷󠁬󠁳󠁿 Wales

Lough Erne eel conserv
ation work could
help save
endange
red species

🏴󠁧󠁢󠁮󠁩󠁲󠁿 North...

📍 Find your

🏴󠁧󠁢󠁷󠁬󠁳󠁿 Wales

Lough Erne eel conservation work could help save endangered species

🏴󠁧󠁢󠁮󠁩󠁲󠁿 Northern Ireland

📍

BBC @joshturnath.uk

A visual comparison of two responsive layouts for a content card. The left example, representing a narrow viewport, shows a single-column layout where text is vertically stacked and words like "conservation" and "endangered" are split across lines. The right example, representing a wider viewport, shows the same content in a more traditional layout with text flowing horizontally. Both examples feature an image of a man outdoors wearing a cap, and text detailing "Lough Erne eel conservation work" along with location information for Wales and Northern Ireland.

Switch to a single column layout at ≈300px viewport width

Left Example (Narrow Layout):

Wales

Lough Erne eel conserv ation work could help save endanger red species

North...

Find your

Right Example (Wider Layout):

Wales

Lough Erne eel conservation work could help save endangered species

Northern Ireland

BBC @joshturnsth.uk

A side-by-side comparison illustrating responsive design. The left example shows a narrow, single-column layout of a content card with a man's photo, reflowed and truncated text about eel conservation, and truncated location text. The right example shows the same content card in a wider layout, with the man's photo and full, un-truncated text about eel conservation and location details. Both cards include a "Wales" heading with a pin icon and an image of three red map pins.
They let you change things depending on the width of a container that you choose, rather than the viewport.

6. Be careful when setting fixed length values.

6. Be careful when setting fixed lengths

6. Be careful when setting fixed lengths

BBC

Always let the content dictate the height of something

BBC bbc.co.uk

Small BBC logo.

Disneyland Paris Website

Screenshot of the Disneyland Paris website displayed in a web browser, showing the homepage with the site's main navigation, a large banner for "Disney Music" featuring characters like Timon, Daisy Duck, Miguel from Coco playing a guitar, and Minnie Mouse as a bandleader. A portion of the footer navigation is also visible.

Avoid a fixed height when there's text inside

nav {
  height: 48px;
}
A slide illustrating a design principle for web development. On the left, a "thumbs down" emoji is shown next to a CSS code snippet setting a fixed height for a navigation bar (`height: 48px`). Below this, a navigation bar example shows text overflowing and being cut off by a green background due to the fixed height. Specifically, the text "2" and "Before you arrive" are partially obscured. On the right, a "thumbs up" emoji indicates a correct approach. Below it, another navigation bar example shows text (e.g., "Our 2 Parks", "Places to stay") fully contained within the green background, which has adjusted its height to accommodate the content. This visually compares the negative effect of a fixed height when text changes or increases, versus allowing the height to adapt.

Avoid a fixed height when there's text inside

nav {	height: 48px;}
nav {	min-height: 48px;}
The slide illustrates a CSS best practice comparison. On the left, a code snippet `height: 48px;` is shown with a thumbs-down emoji, followed by an example of a navigation bar where text elements like "Our 2 Parks" and "Before you arrive" are cut off or overflow due to the fixed height. On the right, a code snippet `min-height: 48px;` is shown with a thumbs-up emoji, followed by an example of a navigation bar where all text elements are fully visible, demonstrating how `min-height` allows the element to expand as needed.

Check out Defensive CSS by Ahmed Shadeed

defensivecss.dev

Screenshot of the 'Tips' section of the Defensive CSS website. It displays a grid of various CSS defensive techniques, each represented by a small diagram or icon and a descriptive title such as 'Flexbox Wrapping', 'Image Distortion', 'Long Content', and 'Component Spacing'.

Check out Defensive CSS by Ahmed Shadeed

defensivecss.dev
A grid of small diagrams, each with a title, representing various CSS tips or patterns, likely an overview from the 'Defensive CSS' website.

Check out Defensive CSS by Ahmed Shadeed

defensivecss.dev

BBC @joshfurnish.uk

A grid of small wireframe diagrams illustrating various CSS layout patterns and UI components, labelled "Tips", from the Defensive CSS website.

Check out Defensive CSS by Ahmed Shadeed

defensivecss.dev

A grid of small thumbnail images illustrating various CSS tips from the Defensive CSS website.

Check out Defensive CSS

by Ahmed Shadeed

defensivecss.dev

@joshturnath.uk

A grid of small wireframe diagrams, labeled "Tips", illustrating various CSS layout scenarios on the Defensive CSS website.

7. Watch out for massive headings

A small BBC logo is visible in the bottom left of the slide.

7. Watch out for massive headings

A small BBC logo is visible in the lower left corner of the main text.

With 200% text scale

A screenshot of an article displaying a large headline, 'The ancient trick making food waste useful and...', broken across multiple lines due to an increased text scale. Below it, a summary reads 'A Stanford University lab has made a cheese-like product from food waste'. Author credits include Alessandra Massa, Anna-Katharina Preidl, and Christine Ro, dated 5 June 2026.

With 200% text scale

The ancient trick making food waste useful and tasty

ALESSANDRA MASSA, ANNA-KATHARINA PREIDL

A Stanford University lab has made a cheese-like product from food waste

Christine Ro
Technology Reporter
5 June 2026, 00:10...

Vayu Hill-Maini's lab has created a new cheese, or at least something that tastes like cheese, but is actually made

BBC @joshburnsrhuk

A simulated news article layout with a headline, author information, and snippets of text, demonstrating the effect of 200% text scaling.

Screenshot of an article about making food waste useful and tasty by Christine Ro

Screenshot of a news article. A small image of a food product is visible at the bottom of the left column.

Headings

Reduce the rate of scaling

increase × (preferred text scale - 1) + 1)

Findings

Define the rate of scaling

Size × (preferred text scale

Prevent large headings

Formula to reduce the rate of scaling

e × (rate of increase × (preferred text scale - 1))

event large headings

formula to reduce the rate of scaling

x × (rate of increase × (preferred text scale - 1)

size-scaling-rate(--font-size <length>, --scaling-rate <number>) { ... }

How to prevent large headings

Use this formula to reduce the rate of scaling

font size × (rate of increase × (preferred text scale - 1) + 1)

@function --font-size-scaling-rate(--font-size <length>, --scaling-rate <number>) {
  result: calc(var(--font-size) * (var(--scaling-rate) * (env(preferred-text-scale) - 1) + 1));
}

h1 {
  font-size: --font-size-scaling-rate(3rem, 0.5);
}

@joshtumath.uk

How to prevent large headings

Use this formula to reduce the rate of scaling

font size × (rate of increase × (preferred text scale - 1) + 1)

@function --font-size-scaling-rate(--font-size <length>, --scaling-rate <number>) {
	result: calc(var(--font-size) * (var(--scaling-rate) * (env(preferred-text-scale) - 1) + 1));
}

h1 {
	font-size: --font-size-scaling-rate(3rem, 0.5);
}

@joshtumath.uk

prevent large headings

formula to reduce the rate of scaling

e × (rate of increase × (preferred text scale - 1)

size-scaling-rate(--font-size <length>, --scaling-rate <number>) { ...

How to prevent large headings

Use this formula to reduce the rate of scaling

font size × (rate of increase × (preferred text scale - 1) + 1)

@function --font-size-scaling-rate(--font-size <length>, --scaling-rate <number>) {
  result: calc(var(--font-size) * (var(--scaling-rate) * (env(preferred-text-scale) - 1) + 1));
}

h1 {
  font-size: --font-size-scaling-rate(3rem, 0.5);
}

How to prevent large headings

Use this formula to reduce the rate of scaling

font size × (rate of increase × (preferred text scale - 1) + 1)

@function --font-size-scaling-rate(--font-size <length>, --scaling-rate <number>) {
  result: calc(var(--font-size) * (var(--scaling-rate) * (env(preferred-text-scale) - 1) + 1));
}

h1 {
  font-size: --font-size-scaling-rate(3rem, 0.5);
}

@joshturnuth.uk

A small BBC logo is visible at the bottom left of the slide.

8. Be ready to opt-in to text scaling

A small BBC logo is visible in the bottom left corner of the slide.

8. Be ready to opt-in to text scaling

8. Be ready to opt-in to text scaling

BBC

BBC logo.

8. Be ready to opt-in to text scaling

Be ready to opt-in to text scaling

Check out the documentation

<meta name="text-scale" content="scale">

The MDN Web Docs logo, featuring a stylized blue 'M' followed by the text "mdn".

BBC PRODUCT GROUP

For

CSS DAY

  • @joshtumath.uk
  • @joshtumath@mastodon.social

© BBC MMXXVI

Made in Salford

The BBC logo features three white squares with black letters B, B, C. A map of the UK and Ireland with a pin marking a location in Salford, England. A blue butterfly icon and a purple Mastodon icon are shown next to social media handles.

BBC PRODUCT GROUP

For

CSS DAY

  • @joshtumath.uk
  • @joshtumath@mastodon.social

© BBC MMXXVI

Made in Salford

A logo for BBC Product Group. A stylized block logo spelling out "CSS DAY". A map of the United Kingdom with a circular marker in the North West, indicating Salford.

BBC PRODUCT GROUP

For

CSS DAY

  • @joshtumath.uk
  • @joshtumath@mastodon.social

© BBC MMXXVI

Made in Salford

BBC logo. Stylized CSS DAY logo made of geometric blocks. Twitter (X) butterfly logo. Mastodon mammoth logo. Map of the United Kingdom with a pinpoint indicating a location in Salford.

BBC PRODUCT GROUP

For

CSS DAY

  • @joshtumath.uk
  • @joshtumath@mastodon.social

© BBC MMXXVI

Made in Salford

The BBC Product Group logo is displayed at the top. Below it is a stylized, blocky logo spelling out "CSS DAY". On the left, a butterfly icon precedes "@joshtumath.uk" and a Mastodon icon precedes "@joshtumath@mastodon.social". On the right, a map of the United Kingdom shows a pin marking Salford.

BBC PRODUCT GROUP

For

CSS DAY

  • @joshtumath.uk
  • @joshtumath@mastodon.social

© BBC MMXXVI

Made in Salford

A slide showing the BBC logo. Below it is the text "PRODUCT GROUP". Below that is the word "For", and then a large, stylized, pixelated logo spelling out "CSS DAY". In the bottom left, there are social media handles: an X (formerly Twitter) icon next to "@joshtumath.uk" and a Mastodon icon next to "@joshtumath@mastodon.social". In the bottom center is "© BBC MMXXVI". In the bottom right is a map of the United Kingdom with a pinpoint marked in the Salford area, and the text "Made in Salford" below it.

BBC PRODUCT GROUP

For

@joshtumath.uk

@joshtumath@mastodon.social

© BBC MMXXVI

Made in Salford

A logo showing the letters B B C each in a square. A stylized logo spelling out CSS DAY. A butterfly icon. A Mastodon 'M' icon. A map of the United Kingdom with a pin marking a location.

BBC PRODUCT GROUP

For

CSS DAY

© BBC MMXXVI

Made in Salford

A stylized logo spelling "CSS DAY" using block-like characters.

A map of the United Kingdom with a pinpoint marker over the location of Salford.

BBC PRODUCT GROUP

For

CSS DAY

© BBC MMXXVI

Made in Salford

BBC logo.

Stylized "CSS DAY" logo made of geometric blocks.

Map of the United Kingdom with a pin highlighting the location of Salford.

Icons for X/Twitter (butterfly) and Mastodon (elephant/mammoth).

BBC PRODUCT GROUP

For

CSS DAY

  • @joshtumath.uk
  • @joshtumath@mastodon.social

© BBC MMXXVI

Made in Salford

The BBC logo is displayed, along with a stylized "CSS DAY" logo. There are icons for Twitter (a butterfly) and Mastodon. A map of the United Kingdom is shown with a dot marking Salford.

BBC PRODUCT GROUP

For

CSS Day

© BBC MMXXVI

Made in Salford

The BBC logo is displayed at the top. Below the text "For", there is a stylized geometric logo that spells out "CSS Day". To the left of the contact information, a butterfly/X icon represents the website/email, and a Mastodon icon represents the social media handle. On the right, a map of the United Kingdom has a pin indicating the city of Salford.

BBC PRODUCT GROUP

For

© BBC MMXXVI

Made in Salford

A stylized blocky logo spelling "CSS DAY".

A map of the United Kingdom with a dot indicating Salford.

Icons of a butterfly and the Mastodon logo precede the contact information.

BBC PRODUCT GROUP

For

CSS DAY

© BBC MMXXVI

Made in Salford

The BBC logo is displayed. A stylized block-pattern logo reads "CSS DAY". A butterfly icon (Twitter/X) and a Mastodon icon are shown next to social media handles. An outline map of the United Kingdom has a single location pinpointed.

BBC PRODUCT GROUP

For

CSS DAY

  • @joshtumath.uk
  • @joshtumath@mastodon.social

© BBC MMXXVI

Made in Salford

The BBC logo, composed of three white letters "BBC" in black squares.

A stylized logo spelling "CSS DAY" in white, blocky, geometric letters.

A blue butterfly icon, representing the Twitter/X logo, next to "@joshtumath.uk".

A purple stylized 'm' icon, representing the Mastodon logo, next to "@joshtumath@mastodon.social".

A white outline map of the United Kingdom with a pinpoint marker over Salford.

BBC PRODUCT GROUP

For

CSS DAY

  • @joshtumath.uk
  • @joshtumath@mastodon.social

© BBC MMXXVI

Made in Salford

A stylized "BBC" logo.

A stylized "CSS DAY" logo.

A butterfly icon next to "@joshtumath.uk".

A Mastodon icon next to "@joshtumath@mastodon.social".

A map of the United Kingdom with a pinpoint marked in the Salford region.

BBC PRODUCT GROUP

For

CSS DAY

© BBC 2026

Made in Salford

BBC logo.

Stylized 'CSS DAY' logo.

Twitter/X bird logo.

Mastodon logo.

Map of the United Kingdom with a pin marking Salford.

BBC PRODUCT GROUP

For

CSS DAY

  • @joshtumath.uk
  • @joshtumath@mastodon.social

© BBC MMXXVI

Made in Salford

A logo for BBC. A stylized logo for CSS Day. Twitter and Mastodon icons. A map of the United Kingdom with a pin marking Salford.

CSS DAY

A logo or stylized text reading 'CSS DAY' formed from black rectangular blocks on a light background.

CSS DAY

#cssday www.cssday.nl

Stylized logo composed of black rectangular blocks forming the letters 'CSS DAY'.

People

  • Ahmed Shadeed
  • Bruce Lawson
  • David Grogan
  • Phil Rogers
  • Vadim McKeev

Technologies & Tools

  • Android
  • Chrome
  • Chromium
  • clamp()
  • Container Queries
  • CSS environment variables
  • CSS Grid
  • Firefox
  • Flexbox
  • iOS
  • Mac OS
  • Media Queries
  • preferred-text-scale
  • rem units
  • Safari
  • text-scale meta tag
  • viewport meta tag
  • Web view
  • Windows 11

Standards & Specs

  • WCAG
  • WHATWG HTML spec

Concepts & Methods

  • Fluid typography
  • Intrinsic web design
  • Mobile first

Organisations & Products

  • Appt
  • BBC
  • CSS Working Group
  • MDN

Works

  • Defensive CSS