Skip to content

Commit a9d8bd5

Browse files
committed
fix: md resolution navbar
1 parent 3d53ba2 commit a9d8bd5

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

themes/basic/assets/css/_header.scss

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@
3333
.menu-button {
3434
display: block;
3535
}
36+
nav.show-on-mobile.nav-links > a {
37+
padding-left: 0;
38+
padding-right: 0;
39+
}
40+
.menu-button:hover {
41+
cursor: pointer;
42+
}
43+
3644
.page-header {
3745
justify-content: space-between;
3846
.header-center {
@@ -48,20 +56,25 @@
4856
border-top: 1px solid #ccc;
4957
position: absolute;
5058
display: flex;
59+
width: 100%;
5160
flex-wrap: wrap;
5261
top: 76px;
5362
left: 0;
5463
a {
5564
text-align: center;
56-
min-width: 28%;
65+
min-width: 33%;
5766
}
5867
}
5968
}
6069
nav.hide-on-mobile {
61-
display: none !important;
62-
height: 0;
70+
max-height: 0;
71+
opacity: 0;
72+
overflow: hidden;
73+
transition: opacity 0.5s;
6374
}
6475
nav.show-on-mobile {
65-
display: flex !important;
76+
opacity: 1;
77+
max-height: 348px;
78+
transition: opacity 0.5s ease;
6679
}
6780
}

themes/basic/assets/js/header-mobile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ document.addEventListener("DOMContentLoaded", function () {
88
}
99

1010
menuButton.addEventListener("click", function () {
11-
var displayStyle = getComputedStyle(menu).display;
12-
if (displayStyle !== "none") {
11+
let menuClass = menu.classList;
12+
if (menuClass.contains("show-on-mobile")) {
1313
hideMenu();
1414
} else {
1515
menu.classList.add("show-on-mobile");

0 commit comments

Comments
 (0)