From 4677a71bd89ef6a7bdfd7019b708cbf08349d5bd Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Thu, 22 Oct 2026 18:20:55 -0400 Subject: [PATCH] fix: Stop iOS blurring the mobile header in the installed web app (#14238) * fix: Solid mobile header in installed web app so iOS does not blur it * fix: Start the standalone header fade opaque at the header edge --- app/components/Header.tsx | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/app/components/Header.tsx b/app/components/Header.tsx index a994999ad4..6e91225a60 100644 --- a/app/components/Header.tsx +++ b/app/components/Header.tsx @@ -168,13 +168,16 @@ function Header({ left, title, actions, hasSidebar, className, ref }: Props) { /** Height of the fade at the bottom of the mobile header background. */ const HeaderFadeHeight = 64; -/** Eased mask stops for the header fade, so it has no visible start or end. */ -const headerFadeStops = [1, 0.85, 0.5, 0.15, 0] - .map( - (opacity, index, stops) => - `rgb(0 0 0 / ${opacity}) calc(100% - ${HeaderFadeHeight * (1 - index / (stops.length - 1))}px)` - ) - .join(", "); +/** Eased mask stops for a fade of the given height, so it has no visible start or end. */ +const fadeStops = (height: number) => + [1, 0.85, 0.5, 0.15, 0] + .map( + (opacity, index, stops) => + `rgb(0 0 0 / ${opacity}) calc(100% - ${height * (1 - index / (stops.length - 1))}px)` + ) + .join(", "); + +const headerFadeStops = fadeStops(HeaderFadeHeight); /** Raised capsule that holds header buttons on mobile, like an iOS toolbar. */ const mobilePill = css` @@ -349,6 +352,16 @@ const Wrapper = styled(Flex)` backdrop-filter: none; mask-image: none; } + + /* iOS blurs the top of an installed web app unless the sticky header has a solid background. */ + @media (display-mode: standalone) { + background: ${props.theme.background}; + + &::before { + background: ${props.theme.background}; + mask-image: linear-gradient(to bottom, ${fadeStops(HeaderFadeHeight / 2)}); + } + } `} `};