Skip to content

Commit e9dd6b4

Browse files
authored
fix(ui): mobile nav items too low, text misaligned with borders (#136)
Root cause: the mobile nav used display:flex, which silently disabled float:right on the close button. The close button consumed ~3.25rem as a flex row, pushing nav items down by two section-heights. Hardcoded rem values also conflicted with the design system's px-based spacing tokens, causing inconsistent rendering on iOS. Fix: - Rewrite mobile nav to display:block so float:right works as designed - Convert all rem values to px or design token variables - Nav list and links also display:block (prevents BFC overlap with float) - Physical properties (top/right/bottom) for cross-browser compatibility - Fix pre-existing import ordering lint error in auth route
1 parent e60c73d commit e9dd6b4

2 files changed

Lines changed: 21 additions & 15 deletions

File tree

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

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -345,42 +345,48 @@ 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;
357-
padding: 1rem;
358-
inline-size: 15rem;
355+
padding: var(--flex-space-md);
356+
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;
367+
block-size: 48px;
368+
inline-size: 48px;
369369
}
370370

371371
.flex-header__nav-list {
372-
flex-direction: column;
373-
align-items: stretch;
374-
inline-size: 100%;
372+
display: block;
373+
list-style: none;
374+
margin: 0;
375+
padding: 0;
375376
}
376377

377378
.flex-header__nav-item {
378379
border-block-start: 1px solid var(--flex-color-border);
379380
}
380381

382+
.flex-header__nav-item:first-child {
383+
border-block-start: 0;
384+
}
385+
381386
.flex-header__nav-link {
382-
padding-block: 0.75rem;
383-
padding-inline: 1rem;
387+
display: block;
388+
block-size: auto;
389+
padding: var(--flex-space-sm) 0;
384390
}
385391

386392
.flex-header__nav-link--current::after,
@@ -448,7 +454,7 @@ flex-header {
448454

449455
@keyframes flex-header-slidein {
450456
0% {
451-
transform: translateX(15rem);
457+
transform: translateX(240px);
452458
}
453459

454460
100% {

src/entrypoints/app/routes/auth/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Hono } from 'hono'
22
import { deleteCookie, setCookie } from 'hono/cookie'
3-
import type { ActivityStore } from '../../../../services/activity'
43
import { Layout } from '../../../../design-system/components/flex-layout'
4+
import type { ActivityStore } from '../../../../services/activity'
55
import type { AccessStore, UserStore } from '../../../../services/auth'
66
import {
77
COOKIE_MAX_AGE,

0 commit comments

Comments
 (0)