From e3b1ba63a6e94589f3d04855fdf2875d6db5adcb Mon Sep 17 00:00:00 2001 From: Ken Sternberg Date: Mon, 13 Nov 2023 14:53:05 -0800 Subject: [PATCH] Function to help generate sizing solutions across Javascript and CSS. --- web/src/elements/utils/getRootStyle.ts | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 web/src/elements/utils/getRootStyle.ts diff --git a/web/src/elements/utils/getRootStyle.ts b/web/src/elements/utils/getRootStyle.ts new file mode 100644 index 000000000..f91d63e5f --- /dev/null +++ b/web/src/elements/utils/getRootStyle.ts @@ -0,0 +1,5 @@ +export function getRootStyle(selector: string, element: HTMLElement = document.documentElement) { + return getComputedStyle(element, null).getPropertyValue(selector); +} + +export default getRootStyle;