export const initViewportExtents = () => { const root = document.querySelector(':root'); if (CSS.supports("(width: 1dvw)") && root) { root.style.setProperty("--viewportWidth", "100dvw"); root.style.setProperty("--viewportHeight", "100dvh"); } else if (root) { const updateUnits = () => { root.style.setProperty("--viewportWidth", `${window.innerWidth}px`); root.style.setProperty("--viewportHeight", `${window.innerHeight}px`); }; window.addEventListener("resize", updateUnits); updateUnits(); } };