Pageworks / papertrain

Papertrain: a Craft CMS 3 framework
http://download.papertrain.io
MIT License
5 stars 2 forks source link

Chrome Viewport Height Fix #87

Closed codewithkyle closed 5 years ago

codewithkyle commented 5 years ago

Source

SCSS height: calc(var(--vh, 1vh) * 100);

TypeScript el.parentElement.style.setProperty('--vh', ${this._vh}px);

window.addEventListener('resize', e => this.handleResize() );

private handleResize(): void{
    if(html.classList.contains('has-no-touch')){
        const vh = window.innerHeight * 0.01;
        el.parentElement.style.setProperty('--vh', `${this._vh}px`);
    }
}