From 937336f4cce06d013b0d21981c1c0bf8a825e15d Mon Sep 17 00:00:00 2001 From: Bkk1234 Date: Fri, 23 Oct 2026 23:43:01 +0700 Subject: [PATCH] Fix mobile topbar alignment: logo left, menu and tools right On <640px the topbar used flex-wrap: wrap with no spacer, so the brand, the hamburger and the theme/language buttons all piled up on the left. - flex-wrap: nowrap at mobile - .mu-menu gets margin-inline-start: auto and order 1, .mu-topbar-tools order 2 - .mu-brand flex: 1 1 auto with min-width: 0 Measured 360/375/414px: brand starts at 14px, tools end flush at the right padding edge, 8px gaps, no horizontal overflow. 768/1280px unchanged. --- DESIGN.md | 2 ++ frontend/src/styles/responsive.css | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/DESIGN.md b/DESIGN.md index d693223..5ac5acc 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -275,6 +275,8 @@ subset thai/latin/latin-ext · ~218 KB) + ไฟล์ `.woff2` 18 ไฟล์ | ธีม (`.mu-pop-btn`) | ไอคอนของโหมดที่ใช้อยู่ (สว่าง/มืด/ตามเวลา) | เปิดเมนู 3 ตัวเลือก `role="menuitemradio"` | | ภาษา (`.mu-pop-btn-lang`) | รหัสภาษาที่ใช้อยู่ (`ไทย` / `EN`) + chevron | เปิดเมนู 2 ภาษา | +- **มือถือ (<640px)** — โลโก้ชิดซ้าย · `(3 ขีด)(ธีม)(ภาษา)` ชิดขวา: `flex-wrap: nowrap` + `margin-inline-start: auto` ที่ `.mu-menu` และ `order: 1/2` ให้เครื่องมือตามหลังเมนู +- **≥640px** — เมนู 3 ขีดซ่อน แสดง `.mu-nav` แทน · `≥1024px` เพิ่มปุ่ม CTA - ปุ่มกลมเหลี่ยม `height 40px` · `radius 8px` · ขอบ `--c-border` · ตัวอักษร `--c-brand-ink` - จอสัมผัส → `44px` - ระยะห่างระหว่างปุ่ม **≥ 8px** (WCAG 2.5.8) diff --git a/frontend/src/styles/responsive.css b/frontend/src/styles/responsive.css index 6a77155..1283de1 100644 --- a/frontend/src/styles/responsive.css +++ b/frontend/src/styles/responsive.css @@ -54,9 +54,11 @@ img, svg, video { max-width: 100%; height: auto; } main.mu-container { padding-top: 24px; padding-bottom: 24px; } /* --- topbar: hamburger menu บนมือถือ (brand + lang + ☰ บรรทัดเดียว) --- */ -.mu-topbar-inner { gap: 8px; padding: 10px 14px; flex-wrap: wrap; } +.mu-topbar-inner { gap: 8px; padding: 10px 14px; flex-wrap: nowrap; } + + .mu-logo-img { width: 36px; height: 36px; } -.mu-brand { gap: 8px; flex-shrink: 0; } +.mu-brand { gap: 8px; flex: 1 1 auto; min-width: 0; } .mu-brand-title { font-size: 1rem; white-space: nowrap; } .mu-brand-subtitle { display: none; } /* กันล้น — โผล่กลับ ≥768px */ .mu-nav { display: none; } /* ซ่อน nav — ใช้ hamburger แทน */ @@ -65,7 +67,8 @@ main.mu-container { padding-top: 24px; padding-bottom: 24px; } .mu-action-btn { display: none; } /* กันล้นบนจอเล็ก — โผล่กลับ ≥1024px */ /* hamburger menu (ขวาสุด) */ -.mu-menu { display: block; position: relative; order: 4; margin-left: 2px; } +.mu-menu { display: block; position: relative; order: 1; margin-left: 0; margin-inline-start: auto; flex-shrink: 0; } + .mu-topbar-tools { order: 2; } .mu-menu-btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;