Skip to content

Commit fcba457

Browse files
committed
mobile menu
1 parent ac5783f commit fcba457

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

style.css

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,19 +279,30 @@ footer {
279279

280280
/* MOBILE MENU */
281281
@media (max-width: 767px) {
282-
.menu-toggle.is-open .menu-content {
283-
transition-behavior:;
284-
flex-direction: column;
282+
.menu-content {
283+
/* Set the starting position for mobile: off-screen to the right */
285284
position: fixed;
286285
top: 0;
287-
left: 0;
286+
right: 0; /* Align to right */
288287
width: 100vw;
289-
/* dvh (Dynamic Viewport Height) prevents gaps on mobile browsers */
290288
height: 100dvh;
289+
background: var(--white);
290+
transform: translateX(100%); /* Hidden off-right */
291+
292+
flex-direction: column;
291293
justify-content: center;
292294
z-index: -1;
293-
padding: 0;
294-
transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.5s ease;
295+
296+
/* This transition handles BOTH opening and closing */
297+
transition:
298+
transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1),
299+
opacity 0.5s ease;
300+
}
301+
302+
.menu-toggle.is-open .menu-content {
303+
transform: translateX(0); /* Slide into view */
304+
opacity: 1;
305+
max-width: 100vw; /* Override any desktop max-width */
295306
}
296307

297308
/* Ensures the body doesn't scroll behind the open menu */

0 commit comments

Comments
 (0)