thiagowfx's avatar

¬ just serendipity 🍀 (not just serendipity)

iOS safari with large fonts

• 145 words • 1 min

⚠️ This post is over one year old. It may no longer be up to date or relevant. Opinions may have changed.

Ever since I switched my blog theme from Hugo PaperMod to my own based on bearblog, I had this weird issue wherein some font sizes, especially within code tags, where quite large.

To illustrate with a rough example:

% ollama serve
Couldn't find '/Users/thiago.perrotta/...'
Your new public key is:
[...]

This would only happen in Safari on iOS.

In particular, it would not happen in Safari on macOS, and it would not be reproducible in the mobile mode of Chrome DevTools.

After a bit of research, I found:

css
body {
  ‑webkit‑text‑size‑adjust: 100%;
}

…fixes the issue perfectly. Source.

It specifies that if you(author) want to resize the text when the browser page is zoomed. Most of the times it is better to set it to auto or 100% as the web browser will take care of how resizing of text is to be done.