Skip to content

Commit f794076

Browse files
committed
Fix mobile navigation style
1 parent 9b08ecd commit f794076

File tree

2 files changed

+62
-16
lines changed

2 files changed

+62
-16
lines changed

assets/scss/blocks/core/navigation.scss

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
background: var(--wp--custom--navigation--background);
4343
bottom: 0;
4444
content: '';
45-
height: 3px;
45+
height: 2px;
4646
left: 0;
4747
position: absolute;
4848
width: 50%;
@@ -52,7 +52,7 @@
5252
background: var(--wp--custom--navigation--background);
5353
bottom: 0;
5454
content: '';
55-
height: 3px;
55+
height: 2px;
5656
left: 50%;
5757
position: absolute;
5858
width: 50%;
@@ -71,7 +71,7 @@
7171
background: var(--wp--custom--navigation--background);
7272
bottom: 0;
7373
content: '';
74-
height: 3px;
74+
height: 2px;
7575
left: 0;
7676
position: absolute;
7777
width: 50%;
@@ -81,7 +81,7 @@
8181
background: var(--wp--custom--navigation--background);
8282
bottom: 0;
8383
content: '';
84-
height: 3px;
84+
height: 2px;
8585
left: 50%;
8686
position: absolute;
8787
width: 50%;
@@ -109,11 +109,20 @@
109109
}
110110

111111
.wp-block-navigation__submenu-icon {
112+
background-color: transparent;
112113
height: 1rem;
113114
width: 1rem;
114115

116+
svg {
117+
stroke: var(--wp--custom--navigation--link);
118+
}
119+
115120
&[aria-expanded='true'] {
116121
transform: rotate(-180deg);
122+
123+
svg {
124+
stroke: var(--wp--custom--navigation--link-hover);
125+
}
117126
}
118127
}
119128

@@ -136,7 +145,7 @@
136145
display: block;
137146
flex-grow: unset;
138147
gap: 0;
139-
padding: 0.3125rem 0.625rem;
148+
padding: 0.3125rem 1.5rem 0.3125rem 0.625rem;
140149
width: 100%;
141150

142151
&::before,
@@ -182,6 +191,12 @@
182191
}
183192
}
184193
}
194+
195+
.wp-block-navigation__submenu-icon {
196+
right: 0;
197+
position: absolute;
198+
top: 25%;
199+
}
185200
}
186201
}
187202
}
@@ -219,7 +234,7 @@
219234

220235
&::before,
221236
&::after {
222-
height: 3px;
237+
height: 2px;
223238
}
224239
}
225240
}
@@ -236,14 +251,16 @@
236251
color: var(--wp--custom--navigation--link);
237252
margin-left: var(--wp--preset--spacing--20);
238253
padding-left: 0;
239-
width: calc(100% - var(--wp--preset--spacing--20));
254+
width: calc(
255+
100% - var(--wp--preset--spacing--20) + 1px
256+
);
240257

241258
&:hover,
242259
&:focus {
243260

244261
&::before,
245262
&::after {
246-
height: 3px;
263+
height: 2px;
247264
}
248265

249266
.wp-block-navigation-item__label {
@@ -271,6 +288,35 @@
271288
.wp-block-navigation__container.is-responsive {
272289
width: 100%;
273290
}
291+
292+
/* Mobile submenu behavior */
293+
.wp-block-navigation-item.has-child {
294+
295+
.wp-block-navigation__submenu-container {
296+
display: none;
297+
transition: all 0.3s ease;
298+
299+
.wp-block-navigation__submenu-container {
300+
left: 100%;
301+
right: auto;
302+
}
303+
}
304+
305+
&:hover {
306+
307+
.wp-block-navigation__submenu-container {
308+
display: block;
309+
transition: all 0.3s ease;
310+
}
311+
}
312+
}
313+
314+
/* Make submenu icon more clickable on mobile */
315+
.wp-block-navigation__submenu-icon {
316+
cursor: pointer;
317+
padding: 0.25rem;
318+
margin-left: 0.5rem;
319+
}
274320
}
275321

276322
@include responsive-mixins.responsive-min(834px) {

theme.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@
197197
"link": "var:preset|color|black",
198198
"link-hover": "var:preset|color|grey-800",
199199
"sublink": "var:preset|color|black",
200-
"sublink-background": "var:preset|color|black",
201-
"sublink-hover": "var:preset|color|white"
200+
"sublink-background": "var:preset|color|grey-300",
201+
"sublink-hover": "var:preset|color|black"
202202
}
203203
},
204204
"layout": {
@@ -309,23 +309,23 @@
309309
"fontStyle": "normal",
310310
"fontWeight": "300",
311311
"src": [
312-
"file:./assets/fonts/body/oxygen-v15-latin-300.woff2"
312+
"file:./build/fonts/body/oxygen-v15-latin-300.woff2"
313313
]
314314
},
315315
{
316316
"fontFamily": "Oxygen",
317317
"fontStyle": "normal",
318318
"fontWeight": "700",
319319
"src": [
320-
"file:./assets/fonts/body/oxygen-v15-latin-700.woff2"
320+
"file:./build/fonts/body/oxygen-v15-latin-700.woff2"
321321
]
322322
},
323323
{
324324
"fontFamily": "Oxygen",
325325
"fontStyle": "normal",
326326
"fontWeight": "400",
327327
"src": [
328-
"file:./assets/fonts/body/oxygen-v15-latin-regular.woff2"
328+
"file:./build/fonts/body/oxygen-v15-latin-regular.woff2"
329329
]
330330
}
331331
]
@@ -340,7 +340,7 @@
340340
"fontStyle": "normal",
341341
"fontWeight": "400",
342342
"src": [
343-
"file:./assets/fonts/headline/Inter.woff2"
343+
"file:./build/fonts/headline/Inter.woff2"
344344
]
345345
}
346346
]
@@ -355,7 +355,7 @@
355355
"fontStyle": "normal",
356356
"fontWeight": "400",
357357
"src": [
358-
"file:./assets/fonts/mono/roboto-mono.woff2"
358+
"file:./build/fonts/mono/roboto-mono.woff2"
359359
]
360360
}
361361
]
@@ -1005,4 +1005,4 @@
10051005
"title": "Page: No Title"
10061006
}
10071007
]
1008-
}
1008+
}

0 commit comments

Comments
 (0)