Skip to content

Commit 7467b66

Browse files
committed
fix(ui): rewrite mobile nav layout from flex to block, rem to px
Root cause: the mobile nav used display:flex, which silently disabled float:right on the close button. The nav-list (also display:flex) created a block formatting context that couldn't overlap the float. Combined with hardcoded rem values (vs the design system's px tokens), this caused the close button to consume ~3.25rem of vertical space, pushing nav items down by roughly two section-heights. Rewrite the mobile nav panel to use display:block throughout: - Nav panel: display:block (via .is-visible), not flex - Nav list: display:block, not flex — no BFC, float works naturally - Nav links: display:block with block-size:auto (override desktop 100%) - Close button: float:right works as originally designed - All rem values → px or design token variables - Physical properties (top/right/bottom) for iOS compatibility - First nav item border removed, link padding-inline zeroed
1 parent bdbb4ac commit 7467b66

1 file changed

Lines changed: 13 additions & 16 deletions

File tree

  • src/design-system/components/flex-header

src/design-system/components/flex-header/styles.css

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -345,38 +345,34 @@ flex-header {
345345

346346
.flex-header__nav {
347347
position: fixed;
348-
inset-inline-end: 0;
349-
inset-block-end: 0;
350-
inset-block-start: 0;
348+
right: 0;
349+
top: 0;
350+
bottom: 0;
351351
background: var(--flex-color-surface);
352352
border-inline-end: 0;
353353
display: none;
354-
flex-direction: column;
355-
justify-content: flex-start;
356354
overflow-y: auto;
357355
padding: var(--flex-space-md);
358356
inline-size: 240px;
359357
z-index: 500;
360358

361359
&.is-visible {
362-
display: flex;
360+
display: block;
363361
animation: flex-header-slidein 0.3s ease-in-out;
364362
}
365363
}
366364

367365
.flex-header__close-btn {
368366
display: block;
369-
position: absolute;
370-
top: var(--flex-space-sm);
371-
right: var(--flex-space-sm);
372-
float: none;
373-
margin: 0;
367+
block-size: 48px;
368+
inline-size: 48px;
374369
}
375370

376371
.flex-header__nav-list {
377-
flex-direction: column;
378-
align-items: stretch;
379-
inline-size: 100%;
372+
display: block;
373+
list-style: none;
374+
margin: 0;
375+
padding: 0;
380376
}
381377

382378
.flex-header__nav-item {
@@ -388,8 +384,9 @@ flex-header {
388384
}
389385

390386
.flex-header__nav-link {
391-
padding-block: 12px;
392-
padding-inline: 0;
387+
display: block;
388+
block-size: auto;
389+
padding: 12px 0;
393390
}
394391

395392
.flex-header__nav-link--current::after,

0 commit comments

Comments
 (0)