Skip to content

Commit 26eb18d

Browse files
committed
[design] improve menu grid and spacing
1 parent 77c3895 commit 26eb18d

File tree

2 files changed

+53
-31
lines changed

2 files changed

+53
-31
lines changed

‎src/css/menu.css‎

Lines changed: 52 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,26 @@
6666
line-height:1;
6767
}
6868

69-
.menu-nav-tab:after,
7069
.menu-nav-tab:after{
7170
background-color: transparent;
7271
border-radius:0;
7372
}
7473

74+
.menu-close-tab{
75+
background-color: transparent;
76+
margin:0;
77+
padding:0;
78+
border-radius:0;
79+
height:3.25em;
80+
width:3.25em;
81+
line-height:1;
82+
}
83+
84+
.menu-close-tab:after{
85+
background-color: transparent;
86+
border-radius:0;
87+
}
88+
7589
.menu-nav-body{
7690
display: none;
7791
}
@@ -141,8 +155,9 @@
141155
.menu-area{
142156
max-height:100%;
143157
grid-template-rows:1fr;
144-
grid-template-columns:2fr4fr auto;
158+
grid-template-columns:15em1frcalc(var(--menu-space) *5);
145159
overflow: hidden;
160+
position: relative;
146161
}
147162

148163
.menu-nav{
@@ -157,12 +172,40 @@
157172
overflow-y: auto;
158173
}
159174

175+
.menu-close{
176+
grid-column-start:3;
177+
grid-column-end:4;
178+
grid-row-start:1;
179+
grid-row-end:2;
180+
align-self: start;
181+
position: absolute;
182+
}
183+
184+
.menu-content{
185+
padding:0calc(var(--menu-space) *5);
186+
grid-column-start:2;
187+
grid-column-end:4;
188+
grid-row-start:1;
189+
grid-row-end:2;
190+
scroll-behavior: smooth;
191+
overflow-y: auto;
192+
}
193+
194+
.menu-content-overscroll{
195+
padding-bottom:calc(var(--menu-space) *30);
196+
}
197+
198+
.menu-content-item{
199+
padding-top:calc(var(--menu-space) *5);
200+
padding-bottom:calc(var(--menu-space) *5);
201+
}
202+
160203
.menu-nav-item{
161204
flex-grow:0;
162205
flex-basis: auto;
163206
}
164207

165-
.menu-nav .menu-nav-tab{
208+
.menu-nav-tab{
166209
padding-left:calc(var(--menu-space) *2);
167210
padding-right:calc(var(--menu-space) *2);
168211
justify-content: flex-start;
@@ -186,32 +229,6 @@
186229
background-color:rgba(var(--theme-color-02),0.5);
187230
}
188231

189-
.menu-close{
190-
grid-column-start:3;
191-
grid-column-end:4;
192-
grid-row-start:1;
193-
grid-row-end:2;
194-
}
195-
196-
.menu-content{
197-
padding:0calc(var(--menu-space) *4);
198-
grid-column-start:2;
199-
grid-column-end:3;
200-
grid-row-start:1;
201-
grid-row-end:2;
202-
overflow-y: auto;
203-
scroll-behavior: smooth;
204-
}
205-
206-
.menu-content-overscroll{
207-
padding-bottom:calc(var(--menu-space) *30);
208-
}
209-
210-
.menu-content-item{
211-
padding-top:calc(var(--menu-space) *3);
212-
padding-bottom:calc(var(--menu-space) *3);
213-
}
214-
215232
.menu-nav-sub{
216233
background-color: transparent;
217234
margin:0;
@@ -232,6 +249,11 @@
232249
border-radius:0;
233250
}
234251

252+
.menu-close-tab{
253+
height:calc(var(--menu-space) *5);
254+
width:calc(var(--menu-space) *5);
255+
}
256+
235257
.menu-item-form{
236258
margin:000calc(var(--menu-space) *3);
237259
}
@@ -240,6 +262,7 @@
240262
@media (min-width:900px){
241263
.menu{
242264
width:80vw;
265+
max-width:60em;
243266
}
244267
}
245268

@@ -252,6 +275,5 @@
252275
@media (min-width:1600px){
253276
.menu{
254277
width:60vw;
255-
max-width:60em;
256278
}
257279
}

‎src/html/menu/menu-close.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<divclass="menu-close">
2-
<buttonclass="menu-nav-tab control-menu-close button" tabindex="-1"><spanclass="icon-close"></span></button>
2+
<buttonclass="menu-close-tab control-menu-close button" tabindex="-1"><spanclass="icon-close"></span></button>
33
</div>

0 commit comments

Comments
(0)