Closed codewithkyle closed 5 years ago
Source
SCSS height: calc(var(--vh, 1vh) * 100);
height: calc(var(--vh, 1vh) * 100);
TypeScript el.parentElement.style.setProperty('--vh', ${this._vh}px);
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`); } }
Source
SCSS
height: calc(var(--vh, 1vh) * 100);
TypeScript
el.parentElement.style.setProperty('--vh', ${this._vh}px);
window.addEventListener('resize', e => this.handleResize() );