A white flash at the top of an iPhone Home Screen web app, and why the fix was the body background color

I built the booking system for my strawberry farm myself (I built my own booking system for strawberry picking). The staff screens are a web app that I added to the iPhone Home Screen, so it opens like an app.
On that app I noticed something. When I switched screens with the bottom menu, the very top of the display, where the clock and battery sit, turned pure white for an instant. This is a record of fixing it the same day.
What was happening
- The phone is an iPhone 16 Pro on iOS 27.2.1
- The top bar of the staff screens is dark brown
- Switching screens with the bottom menu makes a white strip flash around the Dynamic Island
- It is too quick to catch in a screenshot
If the strip were the same dark brown as the top bar, I would not notice it. It stands out because it is white.
I noticed it that morning, while checking two other fixes on the iPhone (a flicker between screens, and a bottom menu out of place). Those two are covered further down.
First try: theme-color set to dark brown (no change)
The first fix was the usual advice.
- Set the page's theme-color to dark brown
- Set theme_color in the web app manifest to dark brown
- Set the html background color to dark brown
I removed the app from the Home Screen, added it again and tested. The white strip was still there.
Second try: the body background set to dark brown too (fixed)
Next, the body background color became dark brown as well. The light page color is now painted on the box that holds the content (main).
This is the actual CSS. look-a is the class on the body of the staff screens. #2e241c is the dark brown of the top bar, and #f3efe9 is the light beige of the page.
@media screen and (max-width: 760px) {
html:has(> body.look-a), body.look-a { background: #2e241c; }
.look-a main { background: #f3efe9; }
}760px is the width where this screen switches to its phone layout. The desktop layout has no top bar, so it keeps the page color.
A dark brown body is not visible in normal use, because the content box fills all the remaining height of the body (the body is a vertical flex container and main has flex: 1). The brown shows only when I pull past the edge of the screen.
That fixed it. This time it worked without adding the app again.

The lead was a report on the Apple Developer Forums: from iOS 26, the color at the very top is taken from the background color of html or body, not from theme-color (report on the Apple Developer Forums). I have not found this in Apple's official documentation. I confirmed it only on my own iPhone 16 Pro.
What went in at the same time, and came out later
The second try included one more idea: a setting that extends the top bar to the very top of the display (apple-mobile-web-app-status-bar-style set to black-translucent), with extra padding above the bar.
I removed it later, for two reasons.
- There is a bug report that it takes effect only when the app is installed (WebKit bug report)
- There is a report that on iOS 27.2 the clock area affects the layout (report on the Apple Developer Forums)
The body background fixed the white strip before I had tested this idea on the phone. I decided not to keep something I had not verified.
Two nearby fixes from the same morning
The bottom menu stayed in the middle of the screen
The menu is meant to be fixed to the bottom. It stayed around the middle of the screen while I scrolled, and got in the way.
There are reports of a bug where, after the keyboard closes, an element fixed to the bottom stays raised by the height of the keyboard (report on the Apple Developer Forums, WebKit bug report). Mine looked the same.
The menu now hides while I type and comes back when I finish.
Flicker when switching screens
- The shared styles moved into the head of the page
- Switching screens now cross-fades only the content, in 0.14 seconds (@view-transition)
I also suspected font loading. The app uses the Japanese typeface Zen Kaku Gothic New, which loads about 70 files for one screen. So I asked for a button, on the test environment only, that switches between the web font and the fonts already on the phone, and compared the two on the iPhone. Neither flickered much. The flicker appeared only on the first load, and not after the fonts were loaded once. The difference was small, so the web font stayed.
How the work went
Claude Code made the fixes, not me. That day it deployed to the test environment four times.
- Fix the flicker and the misplaced bottom menu
- White strip, first try (theme-color and the html background)
- White strip, second try (the body background, plus the black-translucent idea)
- Remove the black-translucent idea, which had not been verified on the phone
All four followed the same steps.
- Claude Code looks for records from people who hit the same problem (Apple Developer Forums, WebKit bug reports)
- It deploys to the test environment
- I check on the real iPhone
Something that lasts an instant does not show on a desktop screen or in a screenshot. Only the person holding the phone can see it, so that part was my job.
Next
Matching the colors is a start. I would like to find better ways to use the space around the Dynamic Island.
Related: I built my own booking system for strawberry picking / One desk for all my Claude Code sessions


