8.0.0 • Published 4 years ago

@mattgh9152/calculatetrueheight v8.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Calculate True Height

A small, basic function, to calculate the true height of your window, and create a CSS variable which represents a true 100vh.

Useful for those annoying mobile bars. Looking at you, Apple.

Install:

npm install @mattgh9152/calculatetrueheight

Import:

import CalculateTrueHeight from "@mattgh9152/calculatetrueheight";

Usage:

CalculateTrueHeight();

On Resize:

You may want to debounce this

window.addEventListener('resize', () => CalculateTrueHeight());

Usage in CSS:

height: 100vh; /**  Fallback for browsers that do not support Custom Properties **/
height: calc(var(--vh, 1vh) * 100);

Npm Repo & Github Page

8.0.0

4 years ago

7.0.0

4 years ago

6.0.0

4 years ago

5.0.0

4 years ago

4.0.0

4 years ago

3.0.0

4 years ago

2.0.0

4 years ago

1.0.0

4 years ago