With the support of CSS custom properties (variables) in iOS, you can set these with JS and use them on iOS only.
const iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
if (iOS) {
document.body.classList.add('ios');
const vh = window.innerHeight / 100;
document.documentElement.style
.setProperty('--ios-10-vh', `${10 * vh}px`);
document.documentElement.style
.setProperty('--ios-50-vh', `${50 * vh}px`);
document.documentElement.style
.setProperty('--ios-100-vh', `${100 * vh}px`);
}
body.ios {
.side-nav {
top: var(--ios-50-vh);
}
section {
min-height: var(--ios-100-vh);
.container {
position: relative;
padding-top: var(--ios-10-vh);
padding-bottom: var(--ios-10-vh);
}
}
}