HACKER Q&A
📣 julienreszka

What are some tricks to develop for Safari for iOS


Do you have some tricks to make things work properly? I'm so tired of the viewport not working correctly.


  👤 julienreszka Accepted Answer ✓
store the innerHeight as a CSS variable:

document.documentElement.style.setProperty('--vh', `${window.innerHeight/100}px`);

.fullheight { height: calc(var(--vh, 1vh) * 100); }

Credits: Mark Racette