- remove shadcn HSL dual-track vars (523->416->~300 lines index.css); tailwind semantic colors (border/background/card/primary/destructive/ popover/muted/accent) now bridge directly to var(--dg-*) tokens - drop dead darkMode:['class'] config and inert dark: variants in kept ui components; theme switching is data-theme based (4 themes intact) - first-frame inline theme script in index.html (reads namespaced key with legacy fallback, resolves system, sets color-scheme) - no flash - consolidate duplicated db-type brand colors into lib/constants.ts single source (dbTypeColorMap + dbTypeBrandColorMap, with pg/mongodb aliases); instance health stroke now uses theme tokens - verified via browser: dark #0d1117 / light #f5f6f8 both resolve, tokens cascade correctly
56 lines
1.6 KiB
JavaScript
56 lines
1.6 KiB
JavaScript
/** @type {import('tailwindcss').Config} */
|
|
module.exports = {
|
|
// 多主题经 data-theme 属性切换(--dg-* 单源),无 class 暗色模式
|
|
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
|
|
theme: {
|
|
extend: {
|
|
colors: {
|
|
// 语义色全部派生自 --dg-* 设计 Token(唯一手写源)
|
|
border: "var(--dg-border)",
|
|
input: "var(--dg-border)",
|
|
ring: "var(--dg-blue)",
|
|
background: "var(--dg-bg-primary)",
|
|
foreground: "var(--dg-text-primary)",
|
|
primary: {
|
|
DEFAULT: "var(--dg-blue)",
|
|
foreground: "#ffffff",
|
|
},
|
|
secondary: {
|
|
DEFAULT: "var(--dg-bg-tertiary)",
|
|
foreground: "var(--dg-text-primary)",
|
|
},
|
|
destructive: {
|
|
DEFAULT: "var(--dg-red)",
|
|
foreground: "#ffffff",
|
|
},
|
|
muted: {
|
|
DEFAULT: "var(--dg-bg-tertiary)",
|
|
foreground: "var(--dg-text-muted)",
|
|
},
|
|
accent: {
|
|
DEFAULT: "var(--dg-bg-hover)",
|
|
foreground: "var(--dg-text-primary)",
|
|
},
|
|
popover: {
|
|
DEFAULT: "var(--dg-bg-secondary)",
|
|
foreground: "var(--dg-text-primary)",
|
|
},
|
|
card: {
|
|
DEFAULT: "var(--dg-bg-secondary)",
|
|
foreground: "var(--dg-text-primary)",
|
|
},
|
|
},
|
|
borderRadius: {
|
|
xl: "calc(var(--radius) + 4px)",
|
|
lg: "var(--radius)",
|
|
md: "calc(var(--radius) - 2px)",
|
|
sm: "calc(var(--radius) - 4px)",
|
|
xs: "calc(var(--radius) - 6px)",
|
|
},
|
|
boxShadow: {
|
|
xs: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
},
|
|
},
|
|
},
|
|
plugins: [require("tailwindcss-animate")],
|
|
} |