tailwind.config.js 1.9 KB
/** @type {import('tailwindcss').Config} */
export default {
  darkMode: "class",
  content: ["./index.html", "./src/**/*.{ts,tsx}"],
  theme: {
    extend: {
      colors: {
        bg: "rgb(var(--bg) / <alpha-value>)",
        surface: "rgb(var(--surface) / <alpha-value>)",
        elevated: "rgb(var(--elevated) / <alpha-value>)",
        line: "rgb(var(--line) / <alpha-value>)",
        ink: "rgb(var(--ink) / <alpha-value>)",
        muted: "rgb(var(--muted) / <alpha-value>)",
        brand: "rgb(var(--brand) / <alpha-value>)",
        brand2: "rgb(var(--brand2) / <alpha-value>)",
        ok: "rgb(var(--ok) / <alpha-value>)",
        warn: "rgb(var(--warn) / <alpha-value>)",
        bad: "rgb(var(--bad) / <alpha-value>)",
      },
      // 六档排版:以前 10 / 10.5 / 11 / 11.5 / 12 / 12.5 / 13 / 13.5 / 14 / 15px 十档混用,
      // 密而不匀,眼睛没有落点。统一成语义档,页面只准用这六个。
      // 层级靠字号和字重拉开:页面标题 > 分区标题 > 正文 / 字段标签 > 说明。最小 12px,再小就看不清了。
      fontSize: {
        caption: ["12px", { lineHeight: "18px" }],
        label: ["13px", { lineHeight: "20px" }],
        body: ["14px", { lineHeight: "22px" }],
        title: ["16px", { lineHeight: "24px" }],
        section: ["18px", { lineHeight: "28px" }],
        page: ["22px", { lineHeight: "32px" }],
      },
      fontFamily: {
        sans: ['"Inter"', '"PingFang SC"', '"Microsoft YaHei"', "system-ui", "sans-serif"],
        mono: ['"JetBrains Mono"', '"Cascadia Code"', "Consolas", "monospace"],
      },
      keyframes: {
        "fade-up": { from: { opacity: "0", transform: "translateY(6px)" }, to: { opacity: "1", transform: "none" } },
        shimmer: { "100%": { transform: "translateX(100%)" } },
      },
      animation: { "fade-up": "fade-up .25s ease both", shimmer: "shimmer 1.6s infinite" },
    },
  },
  plugins: [],
};