返回 CodeWhale
tailwind.config.ts
根目录 / web / tailwind.config.ts
1 import type { Config } from "tailwindcss";
2
3 export default {
4 // Dictionaries carry per-locale class names (e.g. the Arabic and Hindi
5 // docs guide's `leading-loose`); unscanned, those utilities never exist.
6 content: ["./app/**/*.{ts,tsx}", "./components/**/*.{ts,tsx}", "./lib/i18n/dictionaries/**/*.ts"],
7 theme: {
8 extend: {
9 colors: {
10 // Every colour resolves through the role tokens
11 // (app/styles/tokens-roles.css), so the stage and both appearances
12 // re-ink it. Alpha modifiers mix the role toward transparent.
13 ...Object.fromEntries(
14 Object.entries({
15 canvas: "--bg",
16 surface: "--surface",
17 panel: "--panel",
18 fg: "--text",
19 muted: "--muted",
20 line: "--line",
21 accent: "--accent",
22 "on-accent": "--on-accent",
23 hover: "--hover",
24 selected: "--selected",
25 attention: "--attention",
26 live: "--live",
27 success: "--success",
28 danger: "--danger",
29 // Legacy names still used by the docs pages (post-renovation sweep).
30 paper: "--paper",
31 "paper-deep": "--paper-deep",
32 "paper-edge": "--paper-edge",
33 "paper-card": "--paper-card",
34 "paper-line": "--paper-line",
35 "paper-line-soft": "--paper-line-soft",
36 ink: "--ink",
37 "ink-soft": "--ink-soft",
38 "ink-mute": "--ink-mute",
39 indigo: "--indigo",
40 "indigo-deep": "--indigo-deep",
41 "indigo-pale": "--indigo-pale",
42 ochre: "--ochre",
43 jade: "--jade",
44 cobalt: "--cobalt",
45 }).map(([name, role]) => [
46 name,
47 `color-mix(in srgb, var(${role}) calc(<alpha-value> * 100%), transparent)`,
48 ]),
49 ),
50 },
51 fontFamily: {
52 // Every family resolves through the role stacks in
53 // app/styles/tokens-roles.css (Geist faces loaded in app/[locale]/layout.tsx).
54 display: ["var(--font-display)"],
55 body: ["var(--font-body)"],
56 cjk: ["var(--font-cjk)"],
57 mono: ["var(--font-mono)"],
58 },
59 // `transition-colors` and friends use the same motion tokens as
60 // app/styles, so reduced motion stills them too.
61 transitionDuration: { DEFAULT: "var(--dur-state)" },
62 transitionTimingFunction: { DEFAULT: "var(--ease-spring)" },
63 },
64 // Replaces Tailwind's scale with the GPUI radius grammar
65 // (app/styles/tokens-roles.css): 6px controls, 10px surfaces (cards,
66 // code, menus), 14px raised sheets, and pills. Nothing in between.
67 borderRadius: {
68 none: "0",
69 sm: "var(--radius-control)",
70 DEFAULT: "var(--radius-control)",
71 lg: "var(--radius-surface)",
72 xl: "var(--radius-sheet)",
73 full: "var(--radius-pill)",
74 },
75 // Replaces Tailwind's scale so wide tracking cannot be generated: labels
76 // are sentence case at normal tracking. `wide` stays for Han body copy.
77 letterSpacing: {
78 tighter: "-0.05em",
79 tight: "-0.025em",
80 crisp: "-0.018em",
81 normal: "0em",
82 wide: "0.025em",
83 },
84 },
85 // No all-caps anywhere, as in the GPUI app: the `uppercase` utility and
86 // its siblings are not generated.
87 corePlugins: { textTransform: false },
88 plugins: [],
89 } satisfies Config;
90
90 lines TYPESCRIPT