Skip to content

Conversation

@maxchang3
Copy link
Contributor

@maxchang3 maxchang3 commented Jan 5, 2026

Description

Closes #3615

This PR adds text-size-adjust rules on the html element in reset.css to prevent platform-specific, inconsistent font scaling on iOS WebKit when the device orientation changes.


Problem

On iOS Safari (WebKit), rotating to landscape can trigger text autosizing that causes unwanted font-size adjustments across various UI elements, and the sizes may not revert when rotating back.

Solution

Apply -webkit-text-size-adjust: 100% and text-size-adjust: 100% on the html element to keep sizes consistent across orientation changes without affecting user zoom or accessibility settings.

This approach is widely used in mainstream CSS resets, including: normalize.css, tailwindcss/preflight, and modern-normalize.

This feature was originally introduced by Apple and is non-standard in origin1. Although text-size-adjust is now standardized, regarding Safari, only the mobile version2 supports the prefixed -webkit-text-size-adjust, while Chromium supports the unprefixed version34.

Testing

Tested on iOS Safari (iOS 26.1, iPhone 15 Pro). Further testing can be done via the deploy preview provided by this PR.

Before and After Video
Before After
before.mp4
after.mp4

Background reading:

Footnotes

  1. Safari Web Content Guide

  2. Changeset 145168 in webkit, "Remove desktop version of -webkit-text-size-adjust property."

  3. Can I use text-size-adjust ?

  4. text-size-adjust - CSS | MDN

@changeset-bot
Copy link

changeset-bot bot commented Jan 5, 2026

🦋 Changeset detected

Latest commit: 6abbf42

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@astrojs/starlight Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link

netlify bot commented Jan 5, 2026

Deploy Preview for astro-starlight ready!

Name Link
🔨 Latest commit 6abbf42
🔍 Latest deploy log https://app.netlify.com/projects/astro-starlight/deploys/695fdc444067200008cd63da
😎 Deploy Preview https://deploy-preview-3648--astro-starlight.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the 🌟 core Changes to Starlight’s main package label Jan 5, 2026
@astrobot-houston
Copy link
Contributor

Hello! Thank you for opening your first PR to Starlight! ✨

Here’s what will happen next:

  1. Our GitHub bots will run to check your changes.
    If they spot any issues you will see some error messages on this PR.
    Don’t hesitate to ask any questions if you’re not sure what these mean!

  2. In a few minutes, you’ll be able to see a preview of your changes on Netlify 🤩

  3. One or more of our maintainers will take a look and may ask you to make changes.
    We try to be responsive, but don’t worry if this takes a few days.

Copy link
Contributor

@randomguy-2650 randomguy-2650 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this and it seems good to go!

I left a comment regarding about the wording of the changeset but that’s it.

Co-authored-by: randomguy-2650 <[email protected]>
@HiDeoo
Copy link
Member

HiDeoo commented Jan 6, 2026

Thanks for opening a PR, really appreciated 🙌

I think we'll take a look at it in our weekly Discord Talking & Doc'ing event that we use to publicly handle various aspects of the project. You are of course welcome to join us live if you're interested and available!

For such changes that can have a visual impact, and may differ between different users devices or browsers, it's a great way to have many eyes on it and get feedback so I think we will use this opportunity to test the PR on many devices (even Android ones to make sure it does not have any impact there).

@sarah11918
Copy link
Member

Tested deploy preview on S23 Ultra and 14" Android mobile Chrome and this PR doesn't break anything there! Still works on Android for me!

@ArmandPhilippot
Copy link
Member

Tested on Android 15 with Firefox 146.0.1, no issues introduced for me! Great job 🙌🏽

Copy link
Contributor

@trueberryless trueberryless left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!
I tested on an Android device with Google Chrome and Firefox too and it seems to not have broken anything ✅

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and the very thorough documentation and research — appreciate it @maxchang3!

And thanks to everyone who tested this on Talking & Doc’ing! Great to get those extra eyes and testing on a change like this 💖

@delucis delucis added 🌟 patch Change that triggers a patch release ✅ approved Pull requests that have been approved and are ready to merge when next cutting a release labels Jan 12, 2026
@delucis delucis merged commit 292666c into withastro:main Jan 12, 2026
18 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Jan 12, 2026
dadezzz pushed a commit to dadezzz/ice-notes that referenced this pull request Jan 19, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [@astrojs/starlight](https://starlight.astro.build) ([source](https://github.com/withastro/starlight/tree/HEAD/packages/starlight)) | [`0.37.2` → `0.37.3`](https://renovatebot.com/diffs/npm/@astrojs%2fstarlight/0.37.2/0.37.3) | ![age](https://developer.mend.io/api/mc/badges/age/npm/@astrojs%2fstarlight/0.37.3?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@astrojs%2fstarlight/0.37.2/0.37.3?slim=true) |

---

### Release Notes

<details>
<summary>withastro/starlight (@&#8203;astrojs/starlight)</summary>

### [`v0.37.3`](https://github.com/withastro/starlight/blob/HEAD/packages/starlight/CHANGELOG.md#0373)

[Compare Source](https://github.com/withastro/starlight/compare/@astrojs/[email protected]...@astrojs/[email protected])

##### Patch Changes

- [#&#8203;3648](withastro/starlight#3648) [`292666c`](withastro/starlight@292666c) Thanks [@&#8203;maxchang3](https://github.com/maxchang3)! - Prevents unwanted font size adjustments on iOS after orientation changes.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi44Mi4zIiwidXBkYXRlZEluVmVyIjoiNDIuODIuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: Renovate Bot <[email protected]>
Co-committed-by: Renovate Bot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✅ approved Pull requests that have been approved and are ready to merge when next cutting a release 🌟 core Changes to Starlight’s main package 🌟 patch Change that triggers a patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Font size increases when orientation switches to horizontal

9 participants