Viewport Unit Based Typography vs. Safari

A common thing to do regarding font-sizing is to use Viewport Unit Based Typography, nowadays often combined with CSS min() or clamp(): :root { font-size: min(calc(1em + 1vw), 4em); } However, as Sara Soueidan details, Safari doesn’t co-operate here: In Safari on macOS, the fluid text wasn’t really fluid—resizing the viewport did nothing to the …


This content originally appeared on Bram.us and was authored by Bramus!

font-size-vw-tamed

A common thing to do regarding font-sizing is to use Viewport Unit Based Typography, nowadays often combined with CSS min() or clamp():

:root {
  font-size: min(calc(1em + 1vw), 4em);
}

However, as Sara Soueidan details, Safari doesn’t co-operate here:

In Safari on macOS, the fluid text wasn’t really fluid—resizing the viewport did nothing to the font size, even though the latter is supposed to respond to the change in viewport width.

It’s a bug, slated to be fixed in the next version of Safari (Safari TP already has the fix). In the meantime there’s an easy workaround we can use.

More details + demo on Sara’s blog.

Working around the viewport-based fluid typography bug in Safari →

Re-reading that Viewport Unit Based Typography post from 2016 I now see that it also mentions that Safari doesn’t play nice with it. Let this underline the importance of filing bugs: because Sara filed a bug the Safari team came to know about the bug and fixed it (very fast too).


This content originally appeared on Bram.us and was authored by Bramus!


Print Share Comment Cite Upload Translate Updates
APA

Bramus! | Sciencx (2021-06-04T22:39:21+00:00) Viewport Unit Based Typography vs. Safari. Retrieved from https://www.scien.cx/2021/06/04/viewport-unit-based-typography-vs-safari/

MLA
" » Viewport Unit Based Typography vs. Safari." Bramus! | Sciencx - Friday June 4, 2021, https://www.scien.cx/2021/06/04/viewport-unit-based-typography-vs-safari/
HARVARD
Bramus! | Sciencx Friday June 4, 2021 » Viewport Unit Based Typography vs. Safari., viewed ,<https://www.scien.cx/2021/06/04/viewport-unit-based-typography-vs-safari/>
VANCOUVER
Bramus! | Sciencx - » Viewport Unit Based Typography vs. Safari. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/06/04/viewport-unit-based-typography-vs-safari/
CHICAGO
" » Viewport Unit Based Typography vs. Safari." Bramus! | Sciencx - Accessed . https://www.scien.cx/2021/06/04/viewport-unit-based-typography-vs-safari/
IEEE
" » Viewport Unit Based Typography vs. Safari." Bramus! | Sciencx [Online]. Available: https://www.scien.cx/2021/06/04/viewport-unit-based-typography-vs-safari/. [Accessed: ]
rf:citation
» Viewport Unit Based Typography vs. Safari | Bramus! | Sciencx | https://www.scien.cx/2021/06/04/viewport-unit-based-typography-vs-safari/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.