mirror of
https://github.com/shy3130/tick-stock-panel.git
synced 2026-11-02 02:16:13 +00:00
色板里定义了颜色 token base, Tailwind 的 text-base 因此生成 color 规则 (文字被涂成 --base 背景色) 而非 16px 字号 —— 标题字号丢失, accent 底按钮 文字与底色同色不可见。全量替换: 字号意图改写 text-[16px] leading-6, accent 底按钮文字改写 text-white; tailwind.config.ts 注释禁用 text-base。
47 lines
1.8 KiB
TypeScript
47 lines
1.8 KiB
TypeScript
import type { Config } from 'tailwindcss'
|
|
import animate from 'tailwindcss-animate'
|
|
|
|
// 设计语言 §6.0:暗色为主 + 电光蓝强调 + 等宽数字
|
|
export default {
|
|
darkMode: ['class'],
|
|
content: ['./index.html', './src/**/*.{ts,tsx}'],
|
|
theme: {
|
|
container: { center: true, padding: '1rem' },
|
|
extend: {
|
|
colors: {
|
|
// §6.0.1 色板 — CSS variables 见 src/index.css
|
|
// 注意: base 与字号 token 撞名, text-base 会生成 color 规则 (文字变背景色)。
|
|
// 字号 16px 一律写 text-[16px] leading-6, 禁用 text-base。
|
|
base: 'hsl(var(--base) / <alpha-value>)',
|
|
surface: 'hsl(var(--surface) / <alpha-value>)',
|
|
elevated: 'hsl(var(--elevated) / <alpha-value>)',
|
|
border: 'hsl(var(--border) / <alpha-value>)',
|
|
foreground: 'hsl(var(--fg-primary) / <alpha-value>)',
|
|
secondary: 'hsl(var(--fg-secondary) / <alpha-value>)',
|
|
muted: 'hsl(var(--fg-muted) / <alpha-value>)',
|
|
accent: 'hsl(var(--accent) / <alpha-value>)',
|
|
// A 股语义色:仅用于价格 / K 线,不用于 UI 状态
|
|
bull: 'hsl(var(--bull) / <alpha-value>)',
|
|
bear: 'hsl(var(--bear) / <alpha-value>)',
|
|
warning: 'hsl(var(--warning) / <alpha-value>)',
|
|
danger: 'hsl(var(--danger) / <alpha-value>)',
|
|
},
|
|
fontFamily: {
|
|
sans: ['Inter', '"HarmonyOS Sans SC"', '"PingFang SC"', 'system-ui', 'sans-serif'],
|
|
mono: ['"JetBrains Mono"', '"IBM Plex Mono"', 'ui-monospace', 'monospace'],
|
|
},
|
|
borderRadius: {
|
|
card: '8px',
|
|
btn: '6px',
|
|
input: '4px',
|
|
dialog: '12px',
|
|
},
|
|
transitionTimingFunction: {
|
|
// §6.0.4 Linear/Vercel 同款缓动
|
|
smooth: 'cubic-bezier(0.16, 1, 0.3, 1)',
|
|
},
|
|
},
|
|
},
|
|
plugins: [animate],
|
|
} satisfies Config
|