mirror of
https://github.com/outline/outline.git
synced 2026-11-21 21:44:30 +03:00
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
This commit is contained in:
1 parent
3813d6c436
commit
4677a71bd8
1 file changed
+20
-7
@@ -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)<WrapperProps>`
|
||||
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)});
|
||||
}
|
||||
}
|
||||
`}
|
||||
`};
|
||||
|
||||
|
||||
Reference in new issue
Block a user