-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtailwind.config.js
More file actions
220 lines (214 loc) · 8.46 KB
/
Copy pathtailwind.config.js
File metadata and controls
220 lines (214 loc) · 8.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
/** @type {import('tailwindcss').Config} */
export default {
darkMode: ["class"],
content: ['./index.html', './client/**/*.{ts,tsx}'],
theme: {
container: {
center: true,
padding: "2rem",
screens: {
"2xl": "1400px",
},
},
extend: {
fontFamily: {
// Source Serif 4 stands in for Copernicus; Inter for Styrene. Both are
// self-hosted (see client/main.tsx) so there is no CDN round trip.
display: ['"Source Serif 4 Variable"', 'Georgia', '"Songti SC"', '"Noto Serif SC"', 'serif'],
sans: ['"Inter Variable"', '-apple-system', 'BlinkMacSystemFont', '"PingFang SC"', '"Microsoft YaHei"', '"Noto Sans SC"', 'sans-serif'],
mono: ['ui-monospace', 'SFMono-Regular', '"SF Mono"', 'Consolas', 'monospace'],
},
colors: {
border: "hsl(var(--border))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
elevated: "hsl(var(--elevated))",
sunken: "hsl(var(--sunken))",
overlay: "hsl(var(--overlay))",
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
strong: "hsl(var(--primary-strong))",
},
secondary: {
DEFAULT: "hsl(var(--secondary))",
foreground: "hsl(var(--secondary-foreground))",
},
destructive: {
DEFAULT: "hsl(var(--destructive))",
foreground: "hsl(var(--destructive-foreground))",
},
success: {
DEFAULT: "hsl(var(--success))",
foreground: "hsl(var(--success-foreground))",
},
warning: {
DEFAULT: "hsl(var(--warning))",
foreground: "hsl(var(--warning-foreground))",
},
muted: {
DEFAULT: "hsl(var(--muted))",
foreground: "hsl(var(--muted-foreground))",
},
accent: {
DEFAULT: "hsl(var(--accent))",
foreground: "hsl(var(--accent-foreground))",
},
popover: {
DEFAULT: "hsl(var(--popover))",
foreground: "hsl(var(--popover-foreground))",
},
card: {
DEFAULT: "hsl(var(--card))",
foreground: "hsl(var(--card-foreground))",
},
},
borderRadius: {
lg: "var(--radius)",
md: "calc(var(--radius) - 2px)",
sm: "calc(var(--radius) - 4px)",
xl: "calc(var(--radius) + 4px)",
"2xl": "calc(var(--radius) + 10px)",
},
boxShadow: {
// `shadow-xs` shipped in shadcn's Tailwind-v4 templates but was never
// defined here, so seven call sites rendered no shadow at all.
xs: "0 1px 2px hsl(var(--shadow-hue) / 0.05)",
},
/**
* The assistant's every reply renders through `prose`, and the stock
* plugin theme is its own grey ramp -- so the longest-lived text in the
* product was the one surface still ignoring the tokens. Driving the
* `--tw-prose-*` variables from them makes it follow the palette, and
* makes `dark:prose-invert` unnecessary: the tokens already flip.
*/
typography: {
DEFAULT: {
css: {
"--tw-prose-body": "hsl(var(--foreground) / 0.88)",
"--tw-prose-headings": "hsl(var(--foreground))",
"--tw-prose-lead": "hsl(var(--muted-foreground))",
"--tw-prose-links": "hsl(var(--primary-strong))",
"--tw-prose-bold": "hsl(var(--foreground))",
"--tw-prose-counters": "hsl(var(--muted-foreground))",
"--tw-prose-bullets": "hsl(var(--muted-foreground) / 0.6)",
"--tw-prose-hr": "hsl(var(--border))",
"--tw-prose-quotes": "hsl(var(--foreground) / 0.9)",
"--tw-prose-quote-borders": "hsl(var(--primary) / 0.4)",
"--tw-prose-captions": "hsl(var(--muted-foreground))",
"--tw-prose-code": "hsl(var(--foreground))",
"--tw-prose-pre-code": "hsl(var(--foreground))",
"--tw-prose-pre-bg": "hsl(var(--sunken))",
"--tw-prose-th-borders": "hsl(var(--border))",
"--tw-prose-td-borders": "hsl(var(--border) / 0.6)",
maxWidth: "none",
lineHeight: "1.72",
// Assistant headings stay on the UI stack: the display serif has
// no CJK coverage, so Chinese headings dropped to a system serif.
"h1, h2, h3, h4": {
letterSpacing: "-0.015em",
fontWeight: "600",
},
// The plugin wraps inline code in literal backticks; a tinted chip
// says the same thing without the punctuation.
"code::before": { content: '""' },
"code::after": { content: '""' },
":not(pre) > code": {
backgroundColor: "hsl(var(--muted))",
border: "1px solid hsl(var(--border) / 0.6)",
borderRadius: "0.3rem",
padding: "0.1em 0.35em",
fontWeight: "500",
},
// A rule, not a box, and upright rather than italic.
blockquote: {
fontStyle: "normal",
fontWeight: "400",
borderLeftWidth: "2px",
paddingLeft: "1.1em",
},
"blockquote p:first-of-type::before": { content: '""' },
"blockquote p:last-of-type::after": { content: '""' },
a: {
fontWeight: "500",
textDecorationThickness: "1px",
textUnderlineOffset: "2px",
},
// Hairlines only; the plugin's default header rule is heavy.
"thead th": { fontWeight: "600", borderBottomWidth: "1px" },
hr: { borderTopWidth: "1px" },
},
},
},
transitionTimingFunction: {
"out-soft": "cubic-bezier(0.22, 1, 0.36, 1)",
"in-out-soft": "cubic-bezier(0.65, 0, 0.35, 1)",
},
transitionDuration: {
fast: "150ms",
base: "220ms",
slow: "340ms",
},
keyframes: {
"rise-in": {
from: { opacity: "0", transform: "translateY(8px)" },
to: { opacity: "1", transform: "none" },
},
"fade-in": {
from: { opacity: "0" },
to: { opacity: "1" },
},
"scale-in": {
from: { opacity: "0", transform: "scale(0.97)" },
to: { opacity: "1", transform: "none" },
},
// Travelling highlight for streaming/pending text.
sheen: {
from: { backgroundPosition: "200% center" },
to: { backgroundPosition: "-200% center" },
},
// Soft attention pulse that does not change layout.
breathe: {
"0%, 100%": { opacity: "0.55" },
"50%": { opacity: "1" },
},
// Both of these were already referenced from the chat components but
// had never been defined anywhere, so the panels and their messages
// arrived with no animation at all.
"message-in": {
from: { opacity: "0", transform: "translateY(6px)" },
to: { opacity: "1", transform: "none" },
},
"slide-in-right": {
from: { opacity: "0", transform: "translateX(14px)" },
to: { opacity: "1", transform: "none" },
},
},
/**
* `backwards`, not `both`, for anything that animates a transform.
* `forwards` retains the final keyframe, which leaves an identity matrix
* on the element -- and any transform, identity or not, makes it the
* containing block for `position: fixed` descendants. With `both` on the
* chat panel and its message rows, every full-screen overlay inside the
* chat was clipped to the panel instead of covering the viewport.
* These all end at the element's natural state, so reverting to its own
* styles looks identical.
*/
animation: {
"rise-in": "rise-in var(--dur-base) var(--ease-out-soft) backwards",
"fade-in": "fade-in var(--dur-base) var(--ease-out-soft) backwards",
"scale-in": "scale-in var(--dur-base) var(--ease-out-soft) backwards",
sheen: "sheen 2.2s linear infinite",
breathe: "breathe 4s var(--ease-in-out-soft) infinite",
"message-in": "message-in var(--dur-base) var(--ease-out-soft) backwards",
"slide-in-right": "slide-in-right var(--dur-slow) var(--ease-out-soft) backwards",
},
},
},
plugins: [
require("tailwindcss-animate"),
require('@tailwindcss/typography'),
],
}