Align share button and all component scales with DESIGN.md

Share button was themed only in pages/home.css, so /stops, /routes and
/check rendered an unstyled button. Moved to _shared.css and rebuilt as a
ghost variant of .mu-btn:
- radius 12px -> var(--radius) 8px, min-height 44px (48px on touch)
- focus ring #2b2f42 (near-black) -> var(--c-focus)
- LINE link green -> brand purple (DESIGN.md is single-accent)
- hover/active/transition states added

Global scale cleanup (DESIGN.md allows 4px/8px radii only):
- 16 distinct border-radius values -> var(--radius-sm) / var(--radius) / var(--radius-pill)
- 39 distinct font-sizes -> 13-step scale
- outline-offset 1px/2px/3px -> 2px everywhere
- radius and type scale documented in DESIGN.md as enforced tokens

Verified across 4 pages x 2 themes: identical 44x158 button, radius 8px,
contrast 5.80 light / 7.37 dark, no horizontal overflow.
This commit is contained in:
Bkk1234 committed 2026-10-23 23:32:37 +07:00
1 parent 66d7e235c3
commit bf42076b52
14 files changed
+352 -246

No files matched your search

+25
View File
@@ -199,6 +199,31 @@ subset thai/latin/latin-ext · ~218 KB) + ไฟล์ `.woff2` 18 ไฟล์
- ข้อมูลรอง: muted 0.85rem
- hover: ขอบเปลี่ยนเป็น `--purple-300` + `translateY(-1px)` — **ห้ามใส่ shadow**
### ปุ่มแชร์หน้านี้ (`.mu-share-row` / `.mu-share-btn`)
ใช้ร่วมทุกหน้า — `/` · `/stops/:code` · `/routes/:id` · `/check/:id`
(ประกาศใน `styles/_shared.css` **ไม่ใช่** CSS ของหน้าใดหน้าหนึ่ง — เคยหลุดไปอยู่ใน `pages/home.css` ทำให้หน้าอื่นไม่มีสไตล์)
- **variant = ปุ่มรอง (ghost)** เพราะไม่ใช่ CTA หลักของหน้า — CTA หลักคือ topbar `.mu-action-btn`
- พื้น `--c-surface` · ขอบ `1px solid --c-border` · ตัวอักษร `--c-brand-ink` · weight 700
- `min-height: 44px` (48px เมื่อ `@media (pointer: coarse)`) · `padding: 10px 18px` · `gap: 6px`
- ไอคอน `.ic` 16px · `font-size: .85rem` · `line-height: 1`
- hover = ขอบ `#d8c9f2` + พื้น `--c-surface-2` (ไม่มี shadow) · active = `translateY(1px)`
- โฟกัส = `outline: 2px solid var(--c-focus)` + `offset: 2px` — **ห้ามใช้สีดำ/เทา**
- ข้อความสถานะ `.mu-share-status` ใช้ `--c-ink-2` · ลิงก์ที่คัดลอก `.mu-share-url` ใช้ mono + `tabular-nums` + `word-break: break-all`
- ปุ่มแชร์ LINE ใช้ `--c-brand-ink` (ม่วง) — **ไม่ใช้เขียว** เพราะ DESIGN ใช้แอคเซนต์เดียว
- มือถือ (<560px) = ปุ่มเต็มความกว้าง ข้อความชิดซ้าย
### สเกลที่บังคับใช้ (radius / type)
| หมวด | ค่าที่อนุญาต | โทเคน |
|---|---|---|
| มุมโค้ง | **4px · 8px · pill** เท่านั้น | `--radius-sm` · `--radius` · `--radius-pill` |
| ขนาดตัวอักษร | 0.72 · 0.78 · 0.85 · 0.95 · 1 · 1.1 · 1.2 · 1.35 · 1.5 · 1.6 · 1.8 · 2 · 2.2 rem | — |
| ปุ่ม | `min-height 44px` (48px จอสัมผัส) · `radius 8px` · `font-size .85rem` · weight 700 | — |
| โฟกัส | `outline 2px solid var(--c-focus)` · `offset 2px` | — |
> ค่า 12/14/16/18/20/22px และ 0.68/0.7/0.74/0.8/0.82/0.9/1.05 ฯลฯ ถูกยุบในรอบปรับปรุงนี้ — **ห้ามเพิ่มค่าใหม่นอกตาราง** ถ้าจำเป็นให้เพิ่มในไฟล์นี้ก่อน
### ชิปรหัส / เวลา (code chip / departure chip)
- รหัสป้าย/เลขสาย: พื้น `--grad-brand` ตัวอักษรขาว mono 700
- กลุ่มเวลาวางเป็น grid เรียงจากน้อยไปมาก