Skip to content

Commit 2b792c4

Browse files
committed
select root
1 parent 9f8ac19 commit 2b792c4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/sketch.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ function setup() {
4848

4949
// define canvas dimensions for mobile screens
5050
if (window.innerWidth < widthScreen) {
51+
const root = document.querySelector(':root');
5152
root.style.setProperty('--heightScreen', window.innerWidth * (heightScreen / widthScreen) + "px");
5253
root.style.setProperty('--widthScreen', window.innerWidth + "px");
5354
}

0 commit comments

Comments
 (0)