Skip to content

Disable mobile browser text inflation algorithms using CSS #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2025

Conversation

ednolan
Copy link
Contributor

@ednolan ednolan commented Jun 23, 2025

Some browsers, particularly mobile Safari, implement text inflation algorithms intended to improve readability of text on small display sizes. This interacts badly with papers because it can lead to different font size settings being applied to each individual line of code. This commit adds CSS properties which disable the text inflation algorithm.

References:

Apple: https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/AdjustingtheTextSize/AdjustingtheTextSize.html

MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/text-size-adjust

Before/After on iOS Safari:

IMG_8068 IMG_8069

@mpark
Copy link
Owner

mpark commented Jun 26, 2025

This is great, this has been super annoying indeed. Thank you for the fix!

Some browsers, particularly mobile Safari, implement text inflation
algorithms intended to improve readability of text on small display
sizes. This interacts badly with papers because it can lead to
different font size settings being applied to each individual line of
code. This commit adds CSS properties which disable the text inflation
algorithm.

References:

Apple: https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/AdjustingtheTextSize/AdjustingtheTextSize.html

MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/text-size-adjust
@ednolan ednolan force-pushed the enolan_textinflation1 branch from ff650e4 to a81cd32 Compare June 29, 2025 09:47
@mpark mpark merged commit 49c6558 into mpark:master Jun 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants