Last active
October 27, 2020 21:51
-
-
Save scsskid/186622ec00331b2db3743eebc89773fb to your computer and use it in GitHub Desktop.
[ViewPort Height Related Snippets] if -webkit-fill-available isnt enough...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function appHeight() { | |
document.documentElement.style.setProperty( | |
'--vh', | |
window.innerHeight * 0.01 + 'px' | |
); | |
} | |
React.useEffect(() => { | |
// window.addEventListener('resize', appHeight); | |
// appHeight(); | |
}, []); | |
/* | |
CSS: | |
height: 100vh; | |
height: calc(var(--vh, 1vh) * 100); | |
height: -webkit-fill-available; | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment