Skip to content

Commit

Permalink
style: name vh variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Darrin-Lin committed Apr 14, 2024
1 parent 7f4d5bd commit eb7f391
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions my-app/src/Nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ const Nav = () => {
useEffect(() => {
function setVhVariable() {
// 將視窗的高度乘以 0.01 並設置為 --vh 變數的值
let vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty("--vh", `${vh}px`);
let vh_set = window.innerHeight * 0.01;
document.documentElement.style.setProperty("--vh", `${vh_set}px`);
}

// 頁面加載時初始化 --vh 變數
Expand Down

0 comments on commit eb7f391

Please sign in to comment.