主題
Astromer 使用 data-theme + light-dark() 管理亮/暗模式。
在 <html> 上設定 data-theme:
data-theme="light"— 強制亮色data-theme="dark"— 強制暗色data-theme="auto"— 跟隨系統prefers-color-scheme
<html lang="zh-TW" data-theme="auto">用 JavaScript 切換並可選持久化:
document.documentElement.setAttribute("data-theme", "dark");localStorage.setItem("astromer-theme", "dark");頁面載入時從 localStorage 讀回即可。
Token 層級
Section titled “Token 層級”- Primitive — 原色與數值(
@astromer/tokens的 primitives.css) - Semantic —
light-dark()語義變數(semantic.css) - Component — 元件級覆寫(如
--am-button-bg)