Skip to content

Commit 805c8e0

Browse files
committed
kaizen updates
1 parent 98531b5 commit 805c8e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/kaizen-core/helpers/root-variables/h-root-variables.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
const hRootVariablesHandler = () => {
77
document.documentElement.style.setProperty(
88
'--viewport-width',
9-
`${window.innerWidth}px`,
9+
`${document.documentElement.clientWidth}px`,
1010
);
1111
document.documentElement.style.setProperty(
1212
'--viewport-height',
@@ -24,7 +24,7 @@ const hRootVariablesHandler = () => {
2424
).unshift();
2525
if (body) {
2626
hRootVariablesHandler();
27-
['load', 'resize'].forEach((event) =>
27+
['DOMContentLoaded', 'load', 'resize'].forEach((event) =>
2828
window.addEventListener(event, () => hRootVariablesHandler()),
2929
);
3030
}

0 commit comments

Comments
 (0)