dark: make dropdowns readable (select options + pop menus)

- theme.css: colour-scheme per theme for select/input/textarea and explicit
  option/optgroup colours (native popup was rendering light text on white in
  dark mode); :checked uses the purple tint
- _shared.css: token fallbacks on .mu-pop-* so the theme/language menus stay
  readable if tokens fail to load
- VERSION 2026.10.24.7
This commit is contained in:
Bkk1234 committed 2026-11-04 02:24:36 +07:00
1 parent 347ab56546
commit 0aea027fe2
4 files changed
+46 -3

No files matched your search

+10
View File
@@ -816,3 +816,13 @@ body:has(.mu-site-footer) .mu-footer { display: none; }
.mu-update-toast { transition: none; }
.mu-update-dot { animation: none; }
}
/* กันกรณีโทเคนโหลดไม่ครบ (เช่น cache เก่า) — dropdown ต้องอ่านออกเสมอ */
.mu-pop-panel { background: var(--c-surface, #fff); border-color: var(--c-border, #e7e2f6); }
:root[data-theme="dark"] .mu-pop-panel { background: var(--c-surface, #171225); border-color: var(--c-border, #352b52); }
.mu-pop-item { color: var(--c-ink, #1f2a44); }
:root[data-theme="dark"] .mu-pop-item { color: var(--c-ink, #ece9f7); }
.mu-pop-item[data-active="1"] { background: var(--c-tint-purple, #f4f1fb); color: var(--c-brand-ink, #7a4cc0); }
:root[data-theme="dark"] .mu-pop-item[data-active="1"] { background: var(--c-tint-purple, #241c3b); color: var(--c-brand-ink, #b892f5); }
.mu-pop-btn { background: var(--c-surface, #fff); color: var(--c-brand-ink, #7a4cc0); }
:root[data-theme="dark"] .mu-pop-btn { background: var(--c-surface, #171225); color: var(--c-brand-ink, #b892f5); }
+33
View File
@@ -143,3 +143,36 @@ button {
transition: background-color .18s ease, color .18s ease;
}
}
/* ============================================================
dropdown / <select> — ต้องอ่านออกทั้ง light และ dark
ปัญหาเดิม: select ใช้ color ของธีม แต่ option ใช้สีระบบ (ขาว-ขาว)
แก้: บังคับ color-scheme ตามธีม + กำหนดสี option ให้ตรงโทเคน
============================================================ */
select,
input,
textarea {
color-scheme: inherit;
}
:root[data-theme="dark"] select,
:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea {
color-scheme: dark;
}
:root[data-theme="light"] select,
:root[data-theme="light"] input,
:root[data-theme="light"] textarea {
color-scheme: light;
}
option,
optgroup {
background-color: var(--c-surface);
color: var(--c-ink);
}
/* Firefox: สีของ popup ตามสี option ที่ประกาศไว้ */
@supports (-moz-appearance: none) {
option:checked {
background-color: var(--c-tint-purple);
color: var(--c-brand-ink);
}
}