mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Added margin to bottom of Admin when installed as PWA on newer iOS devices (#1667)
no issue On newer iOS devices with no home button, we have this bar at the bottom of the screen instead. When installed as a PWA, the mobile nav sits under that bar. I'm unsure how much Ghost is used this way, but this is a small QOL improvement for those who do. This PR uses the native `env` CSS custom properties Safari has to add a propriety amount of `padding-bottom` to the mobile nav bar, and also the global container to prevent anything in the iframe from being hidden by the taller nav bar. If the device does not support these `env` vars, is has no adverse affect. In order for this to work, the `<meta name="viewport" />` tag needs `viewport-fit=cover` added to it. MDN docs for reference: https://developer.mozilla.org/en-US/docs/Web/CSS/env
This commit is contained in:
parent
c38ca94683
commit
8062fa8994
2 changed files with 13 additions and 1 deletions
|
@ -11,7 +11,7 @@
|
|||
|
||||
<meta name="HandheldFriendly" content="True" />
|
||||
<meta name="MobileOptimized" content="320" />
|
||||
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1, minimal-ui" />
|
||||
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1, minimal-ui, viewport-fit=cover" />
|
||||
<meta name="pinterest" content="nopin" />
|
||||
|
||||
<meta http-equiv="cleartype" content="on" />
|
||||
|
|
|
@ -635,6 +635,12 @@
|
|||
padding-bottom: 55px;
|
||||
}
|
||||
|
||||
@supports (padding-bottom: env(safe-area-inset-bottom)) {
|
||||
.gh-viewport {
|
||||
padding-bottom: calc(55px + env(safe-area-inset-bottom, 0px));
|
||||
}
|
||||
}
|
||||
|
||||
.gh-mobile-nav-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
@ -647,6 +653,12 @@
|
|||
border-top: var(--lightgrey) 1px solid;
|
||||
}
|
||||
|
||||
@supports (padding-bottom: env(safe-area-inset-bottom)) {
|
||||
.gh-mobile-nav-bar {
|
||||
padding-bottom: env(safe-area-inset-bottom, 0px);
|
||||
}
|
||||
}
|
||||
|
||||
.gh-mobile-nav-bar a,
|
||||
.gh-mobile-nav-bar-more {
|
||||
height: 55px;
|
||||
|
|
Loading…
Add table
Reference in a new issue