From f6a2e817829c193628f40eba43d469ee42309d57 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Mon, 23 Dec 2019 11:10:29 -0500 Subject: [PATCH] [+] Create vh to px function --- src/responsive.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/responsive.ts b/src/responsive.ts index e89fe41..94c3363 100644 --- a/src/responsive.ts +++ b/src/responsive.ts @@ -12,3 +12,13 @@ export default class Responsive this.margin = margin; } } + +/** + * vh to px + * + * @param vh + */ +function vhToPx(vh: number): number +{ + return document.documentElement.clientHeight * vh / 100; +}