theme: dark mode + theme tokens (parity with web-at-transit)
- ui/theme.css: token set copied value-for-value from the Next app (--c-surface/-ink/-border/-brand/-tint/-glass + radius), light and dark blocks - ui/theme.js: 3-mode switch (light / dark / auto=prefers-color-scheme) with a header dropdown, aria-haspopup/menu, Esc/outside close, live matchMedia listener - index.html: pre-paint theme script (no flash), theme.css link before _shared.css - remapped ~290 literal colours in _shared.css/index.html/partials to var(--c-*) so both projects render from the same tokens; dark patch block covers the remaining decorative gradients - DESIGN.md: new section 3.2 (theme tokens + where to add colours) - VERSION 2026.09.27.114
This commit is contained in:
1 parent
bea8f0773e
commit
cdfd77ffff
18 files changed
+742
-329
No files matched your search
@@ -115,6 +115,17 @@
|
||||
- **ชื่อเฉพาะไม่แปล** — ชื่อสถานี จังหวัด สายรถ (ภาษาไทยเสมอ)
|
||||
- **ตรวจก่อน commit:** `python resource/tools/check-i18n.py`
|
||||
|
||||
|
||||
## 3.2 ธีม (light / dark / ตามอุปกรณ์) — `ui/theme.css`
|
||||
|
||||
- **โทเคนสีทุกตัวอยู่ใน `ui/theme.css`** (`--c-*`) — ค่าเดียวกับ `web-at-transit/frontend/src/styles/theme.css`
|
||||
(GUI สองโปรเจกต์ต้องตรงกัน ห้ามแก้ค่าข้างเดียว)
|
||||
- โหมด: `light` · `dark` · `auto` = **ตามธีมอุปกรณ์** (`prefers-color-scheme`) ← ค่าเริ่มต้น
|
||||
- ตั้งค่า: `<html data-theme="light|dark">` + `data-theme-mode="light|dark|auto"` · เก็บที่ `localStorage.at_theme`
|
||||
- ปุ่มใน header = dropdown (ไอคอนเปลี่ยนตามโหมด) · สคริปต์ก่อน paint อยู่ใน `index.html` (กันจอขาววูบ)
|
||||
- **ห้ามใส่ hex ใหม่ในไฟล์ CSS/partial** — ถ้าจำเป็นให้เพิ่มเป็นโทเคนคู่ light/dark ที่นี่ก่อน
|
||||
(ยกเว้นสีที่ต้องคงที่ทุกธีม เช่น `#fff` บนพื้นแบรนด์ และไล่เฉดภาพประดับ)
|
||||
|
||||
## 4. ตัวพิมพ์ (Typography)
|
||||
|
||||
```css
|
||||
|
||||
Reference in new issue
Block a user