Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

themePalettes.ts

773 lines35.7 KB

1export const BUILT_IN_THEME_IDS = ["t3-chat", "grove", "ocean", "ember", "iris"] as const;
2​
3/** The mobile app's own hand-tuned palette, which is not part of the built-in library. */
4export const MOBILE_DEFAULT_THEME_ID = "t3-code";
5​
6/**
7 * Every palette the mobile app can render. Declared here so host-side tooling
8 * (the app-store screenshot harness) can validate a requested theme without
9 * importing React Native application code.
10 */
11export const MOBILE_THEME_IDS = [MOBILE_DEFAULT_THEME_ID, ...BUILT_IN_THEME_IDS] as const;
12​
13/**
14 * Ids a theme may not take: the appearance keywords a stored preference uses,
15 * every built-in, and the legacy aliases older saves still carry. Taking one
16 * would either be shadowed by the built-in or capture clients that never chose
17 * it, so the client library and the publish path both consult this set.
18 */
19export const RESERVED_THEME_IDS: ReadonlySet<string> = new Set([
20 "system",
21 "light",
22 "dark",
23 ...BUILT_IN_THEME_IDS,
24 "t3-chat-dark",
25 "t3-grove",
26 "t3-ocean",
27 "t3-ember",
28 "t3-iris",
29]);
30​
31/**
32 * Additionally closed to a machine publishing a theme: the mobile default is
33 * not a web or desktop built-in, so a saved theme may legitimately carry that
34 * id, but no client that follows published themes can resolve it -- publishing
35 * it would report success and change nothing.
36 */
37export const UNPUBLISHABLE_THEME_IDS: ReadonlySet<string> = new Set([
38 ...RESERVED_THEME_IDS,
39 MOBILE_DEFAULT_THEME_ID,
40]);
41​
42export type BuiltInThemeId = (typeof BUILT_IN_THEME_IDS)[number];
43export type MobileThemeId = (typeof MOBILE_THEME_IDS)[number];
44export type ThemeAppearance = "light" | "dark";
45​
46/** Product roles shared by web CSS, React Native tokens, and native surfaces. */
47export const THEME_COLOR_ROLES = [
48 "canvas",
49 "chrome",
50 "toolbar",
51 "toolbarForeground",
52 "toolbarBorder",
53 "toolbarControl",
54 "toolbarControlForeground",
55 "toolbarControlHover",
56 "surface",
57 "surfaceRaised",
58 "surfaceOverlay",
59 "text",
60 "textMuted",
61 "border",
62 "input",
63 "focus",
64 "accent",
65 "accentForeground",
66 "secondary",
67 "secondaryForeground",
68 "muted",
69 "mutedForeground",
70 "placeholder",
71 "secondaryLabel",
72 "iconMuted",
73 "error",
74 "errorForeground",
75 "errorSurface",
76 "warning",
77 "warningForeground",
78 "warningSurface",
79 "update",
80 "updateForeground",
81 "updateSurface",
82 "accentSurface",
83 "accentSurfaceForeground",
84 "messageSurface",
85 "messageForeground",
86 "messageAction",
87 "messageActionForeground",
88 "messageActionHover",
89 "codeBackground",
90 "codeForeground",
91 "sidebar",
92 "sidebarForeground",
93 "sidebarMutedForeground",
94 "sidebarControlSurface",
95 "sidebarRowHover",
96 "sidebarRowActive",
97 "sidebarRowSelected",
98 "sidebarBorder",
99 "terminalBackground",
100 "terminalForeground",
101 "terminalCursor",
102 "terminalSelection",
103 "terminalScrollbar",
104 "terminalScrollbarHover",
105] as const;
106​
107export type ThemeColorRole = (typeof THEME_COLOR_ROLES)[number];
108export type ThemeColors = Readonly<Record<ThemeColorRole, string>>;
109export type ThemeVariants = Readonly<Partial<Record<ThemeAppearance, ThemeColors>>>;
110export type ThemeDefinition = Readonly<{
111 id: string;
112 label: string;
113 appearance: ThemeAppearance;
114 colors: ThemeColors;
115 variants?: ThemeVariants;
116 /** Groups related imported variants into one library card. */
117 collection?: Readonly<{ id: string; label: string }>;
118 /** Allows reviewed built-ins to render product artwork over their sidebar. */
119 sidebarArtwork?: boolean;
120 /** Generated from the guided editor's canvas and accent roles. */
121 managed?: boolean;
122}>;
123​
124export const T3_CHAT_THEME: ThemeDefinition = {
125 id: "t3-chat",
126 label: "T3 Chat",
127 appearance: "light",
128 colors: {
129 canvas: "oklch(0.982446 0.010114 325.653)",
130 chrome: "oklch(0.982446 0.010114 325.653)",
131 toolbar: "oklch(0.982446 0.010114 325.653)",
132 toolbarForeground: "oklch(0.325698 0.116116 325.037)",
133 toolbarBorder: "oklch(0.856784 0.082879 328.911)",
134 toolbarControl: "oklch(0.939552 0.024286 321.664)",
135 toolbarControlForeground: "oklch(0.325698 0.116116 325.037)",
136 toolbarControlHover: "oklch(0.884525 0.041658 337.177)",
137 surface: "oklch(0.971835 0.012884 321.894)",
138 surfaceRaised: "oklch(0.988235 0.005049 325.615)",
139 surfaceOverlay: "oklch(1 0 0)",
140 text: "oklch(0.325698 0.116116 325.037)",
141 textMuted: "oklch(0.494754 0.190937 354.544)",
142 border: "oklch(0.923531 0.021247 328.096)",
143 input: "oklch(0.851713 0.055822 336.6)",
144 focus: "oklch(0.591646 0.217985 0.584)",
145 accent: "oklch(0.591646 0.217985 0.584)",
146 accentForeground: "oklch(1 0 0)",
147 secondary: "oklch(0.869588 0.06751 334.899)",
148 secondaryForeground: "oklch(0.444777 0.134061 324.799)",
149 muted: "oklch(0.802407 0.090963 345.892)",
150 mutedForeground: "oklch(0.428932 0.163929 354.332)",
151 placeholder: "oklch(0.549927 0.090215 323.149)",
152 secondaryLabel: "oklch(0.494754 0.190937 354.544)",
153 iconMuted: "oklch(0.494754 0.190937 354.544)",
154 error: "oklch(0.627117 0.248974 7.734)",
155 errorForeground: "oklch(0.458704 0.169677 3.815)",
156 errorSurface: "oklch(0.942787 0.032076 344.963)",
157 warning: "oklch(0.76859 0.164659 70.08)",
158 warningForeground: "oklch(0.54612 0.143036 48.949)",
159 warningSurface: "oklch(0.962901 0.015297 48.56)",
160 update: "oklch(0.591646 0.217985 0.584)",
161 updateForeground: "oklch(0.494754 0.190937 354.544)",
162 updateSurface: "oklch(0.930264 0.036194 341.45)",
163 accentSurface: "oklch(0.939552 0.024286 321.664)",
164 accentSurfaceForeground: "oklch(0.396296 0.025134 285.196)",
165 messageSurface: "oklch(0.926746 0.037898 332.6)",
166 messageForeground: "oklch(0.354591 0.093575 307.568)",
167 messageAction: "oklch(0.591646 0.217985 0.584)",
168 messageActionForeground: "oklch(1 0 0)",
169 messageActionHover: "oklch(0.539042 0.197866 0.305)",
170 codeBackground: "oklch(0.953855 0.019695 315.668)",
171 codeForeground: "oklch(0.445128 0.13005 307.026)",
172 sidebar: "oklch(0.928886 0.031178 322.592)",
173 sidebarForeground: "oklch(0.396296 0.025134 285.196)",
174 sidebarMutedForeground: "oklch(0.494754 0.190937 354.544)",
175 sidebarControlSurface: "oklch(0.978851 0.001321 106.424)",
176 sidebarRowHover: "oklch(0.978851 0.001321 106.424)",
177 sidebarRowActive: "oklch(0.978851 0.001321 106.424)",
178 sidebarRowSelected: "oklch(0.978851 0.001321 106.424)",
179 sidebarBorder: "oklch(0.938313 0.002552 48.717)",
180 terminalBackground: "oklch(0.982446 0.010114 325.653)",
181 terminalForeground: "oklch(0.325698 0.116116 325.037)",
182 terminalCursor: "oklch(0.591646 0.217985 0.584)",
183 terminalSelection: "oklch(0.869588 0.06751 334.899)",
184 terminalScrollbar: "oklch(0.851713 0.055822 336.6)",
185 terminalScrollbarHover: "oklch(0.802407 0.090963 345.892)",
186 },
187 variants: {
188 dark: {
189 canvas: "oklch(0.22813 0.020366 307.469)",
190 chrome: "oklch(0.22813 0.020366 307.469)",
191 toolbar: "oklch(0.22813 0.020366 307.469)",
192 toolbarForeground: "oklch(0.980735 0.004092 301.426)",
193 toolbarBorder: "oklch(0.266943 0.015262 302.425)",
194 toolbarControl: "oklch(0.313674 0.030572 310.061)",
195 toolbarControlForeground: "oklch(0.848252 0.038248 307.961)",
196 toolbarControlHover: "oklch(0.364912 0.050794 308.491)",
197 surface: "oklch(0.267101 0.02016 311.799)",
198 surfaceRaised: "oklch(0.279864 0.021572 309.532)",
199 surfaceOverlay: "oklch(0.154761 0.01316 338.901)",
200 text: "oklch(0.980735 0.004092 301.426)",
201 textMuted: "oklch(0.880303 0.03077 342.696)",
202 border: "oklch(0.266943 0.015262 302.425)",
203 input: "oklch(0.266817 0.02897 344.461)",
204 focus: "oklch(0.591646 0.217985 0.584)",
205 accent: "oklch(0.460685 0.185347 4.099)",
206 accentForeground: "oklch(0.901233 0.057189 343.694)",
207 secondary: "oklch(0.313674 0.030572 310.061)",
208 secondaryForeground: "oklch(0.848252 0.038248 307.961)",
209 muted: "oklch(0.360924 0.021469 316.83)",
210 mutedForeground: "oklch(0.880303 0.03077 342.696)",
211 placeholder: "oklch(0.657087 0.028226 307.985)",
212 secondaryLabel: "oklch(0.880303 0.03077 342.696)",
213 iconMuted: "oklch(0.848252 0.038248 307.961)",
214 error: "oklch(0.458704 0.169677 3.815)",
215 errorForeground: "oklch(0.901233 0.057189 343.694)",
216 errorSurface: "oklch(0.259022 0.04799 340.062)",
217 warning: "oklch(0.76859 0.164659 70.08)",
218 warningForeground: "oklch(0.836861 0.164422 84.429)",
219 warningSurface: "oklch(0.321706 0.036256 60.806)",
220 update: "oklch(0.460685 0.185347 4.099)",
221 updateForeground: "oklch(0.901233 0.057189 343.694)",
222 updateSurface: "oklch(0.256077 0.063004 342.914)",
223 accentSurface: "oklch(0.364912 0.050794 308.491)",
224 accentSurfaceForeground: "oklch(0.964695 0.009139 341.803)",
225 messageSurface: "oklch(0.273791 0.025541 309.079)",
226 messageForeground: "oklch(0.949872 0.021269 306.838)",
227 messageAction: "oklch(0.460685 0.185347 4.099)",
228 messageActionForeground: "oklch(0.901233 0.057189 343.694)",
229 messageActionHover: "oklch(0.458754 0.184639 3.857)",
230 codeBackground: "oklch(0.22813 0.020366 307.469)",
231 codeForeground: "oklch(0.848703 0.064239 306.645)",
232 sidebar: "oklch(0.185778 0.019368 322.159)",
233 sidebarForeground: "oklch(0.967434 0.001326 286.375)",
234 sidebarMutedForeground: "oklch(0.880303 0.03077 342.696)",
235 sidebarControlSurface: "oklch(0.23366 0.026081 338.196)",
236 sidebarRowHover: "oklch(0.23366 0.026081 338.196)",
237 sidebarRowActive: "oklch(0.23366 0.026081 338.196)",
238 sidebarRowSelected: "oklch(0.23366 0.026081 338.196)",
239 sidebarBorder: "oklch(0.269132 0.030766 351.067)",
240 terminalBackground: "oklch(0.22813 0.020366 307.469)",
241 terminalForeground: "oklch(0.980735 0.004092 301.426)",
242 terminalCursor: "oklch(0.591646 0.217985 0.584)",
243 terminalSelection: "oklch(0.313674 0.030572 310.061)",
244 terminalScrollbar: "oklch(0.266817 0.02897 344.461)",
245 terminalScrollbarHover: "oklch(0.360924 0.021469 316.83)",
246 },
247 },
248 sidebarArtwork: true,
249};
250​
251export const GROVE_THEME: ThemeDefinition = {
252 id: "grove",
253 label: "Grove",
254 appearance: "light",
255 colors: {
256 canvas: "oklch(0.972369 0.005497 157.15)",
257 chrome: "oklch(0.972369 0.005497 157.15)",
258 toolbar: "oklch(0.972369 0.005497 157.15)",
259 toolbarForeground: "oklch(0.222003 0.03479 328.979)",
260 toolbarBorder: "oklch(0.909438 0.021521 164.612)",
261 toolbarControl: "oklch(0.936464 0.014601 163.554)",
262 toolbarControlForeground: "oklch(0.222003 0.03479 328.979)",
263 toolbarControlHover: "oklch(0.909438 0.021521 164.612)",
264 surface: "oklch(0.972369 0.005497 157.15)",
265 surfaceRaised: "oklch(0.949276 0.004496 159.002)",
266 surfaceOverlay: "oklch(0.932695 0.003778 160.944)",
267 text: "oklch(0.222003 0.03479 328.979)",
268 textMuted: "oklch(0.540472 0.014944 326.176)",
269 border: "oklch(0.864831 0.01312 167.255)",
270 input: "oklch(0.829746 0.016084 168.234)",
271 focus: "oklch(0.523295 0.112292 158.089)",
272 accent: "oklch(0.523295 0.112292 158.089)",
273 accentForeground: "oklch(0.990339 0.008411 325.64)",
274 secondary: "oklch(0.936464 0.014601 163.554)",
275 secondaryForeground: "oklch(0.222003 0.03479 328.979)",
276 muted: "oklch(0.945455 0.012308 162.879)",
277 mutedForeground: "oklch(0.527266 0.012309 320.683)",
278 placeholder: "oklch(0.529681 0.01551 326.299)",
279 secondaryLabel: "oklch(0.540472 0.014944 326.176)",
280 iconMuted: "oklch(0.540472 0.014944 326.176)",
281 error: "oklch(0.637823 0.237287 25.436)",
282 errorForeground: "oklch(0.509494 0.208583 28.513)",
283 errorSurface: "oklch(0.936968 0.014243 26.295)",
284 warning: "oklch(0.772406 0.172798 65.367)",
285 warningForeground: "oklch(0.545036 0.155019 45.359)",
286 warningSurface: "oklch(0.953175 0.02009 93.379)",
287 update: "oklch(0.523295 0.112292 158.089)",
288 updateForeground: "oklch(0.388012 0.080082 158.768)",
289 updateSurface: "oklch(0.900411 0.02384 164.795)",
290 accentSurface: "oklch(0.909438 0.021521 164.612)",
291 accentSurfaceForeground: "oklch(0.222003 0.03479 328.979)",
292 messageSurface: "oklch(0.891377 0.026164 164.929)",
293 messageForeground: "oklch(0.222003 0.03479 328.979)",
294 messageAction: "oklch(0.535028 0.106403 77.549)",
295 messageActionForeground: "oklch(0.990339 0.008411 325.64)",
296 messageActionHover: "oklch(0.488753 0.096536 77.829)",
297 codeBackground: "oklch(0.955888 0.004783 158.391)",
298 codeForeground: "oklch(0.222003 0.03479 328.979)",
299 sidebar: "oklch(0.936464 0.014601 163.554)",
300 sidebarForeground: "oklch(0.222003 0.03479 328.979)",
301 sidebarMutedForeground: "oklch(0.515606 0.011938 318.897)",
302 sidebarControlSurface: "oklch(0.88585 0.011734 166.331)",
303 sidebarRowHover: "oklch(0.886676 0.027374 164.983)",
304 sidebarRowActive: "oklch(0.85335 0.03597 165.158)",
305 sidebarRowSelected: "oklch(0.836654 0.040284 165.149)",
306 sidebarBorder: "oklch(0.860274 0.010287 168.339)",
307 terminalBackground: "oklch(0.972369 0.005497 157.15)",
308 terminalForeground: "oklch(0.222003 0.03479 328.979)",
309 terminalCursor: "oklch(0.523295 0.112292 158.089)",
310 terminalSelection: "oklch(0.891377 0.026164 164.929)",
311 terminalScrollbar: "oklch(0.824752 0.001392 294.641)",
312 terminalScrollbarHover: "oklch(0.755495 0.004415 318.776)",
313 },
314 variants: {
315 dark: {
316 canvas: "oklch(0.260865 0.02152 162.75)",
317 chrome: "oklch(0.260865 0.02152 162.75)",
318 toolbar: "oklch(0.260865 0.02152 162.75)",
319 toolbarForeground: "oklch(0.990339 0.008411 325.64)",
320 toolbarBorder: "oklch(0.464636 0.066083 158.72)",
321 toolbarControl: "oklch(0.380487 0.048313 159.608)",
322 toolbarControlForeground: "oklch(0.990339 0.008411 325.64)",
323 toolbarControlHover: "oklch(0.437021 0.060312 158.962)",
324 surface: "oklch(0.260865 0.02152 162.75)",
325 surfaceRaised: "oklch(0.363192 0.016572 165.32)",
326 surfaceOverlay: "oklch(0.411828 0.014378 166.627)",
327 text: "oklch(0.990339 0.008411 325.64)",
328 textMuted: "oklch(0.666747 0.004239 187.292)",
329 border: "oklch(0.457475 0.044046 160.971)",
330 input: "oklch(0.519849 0.049896 160.863)",
331 focus: "oklch(0.796228 0.133058 157.319)",
332 accent: "oklch(0.796228 0.133058 157.319)",
333 accentForeground: "oklch(0.222003 0.03479 328.979)",
334 secondary: "oklch(0.380487 0.048313 159.608)",
335 secondaryForeground: "oklch(0.990339 0.008411 325.64)",
336 muted: "oklch(0.339728 0.039456 160.274)",
337 mutedForeground: "oklch(0.715427 0.010896 171.428)",
338 placeholder: "oklch(0.739243 0.002222 223.225)",
339 secondaryLabel: "oklch(0.666747 0.004239 187.292)",
340 iconMuted: "oklch(0.666747 0.004239 187.292)",
341 error: "oklch(0.655108 0.221148 23.473)",
342 errorForeground: "oklch(0.704237 0.187511 22.228)",
343 errorSurface: "oklch(0.312773 0.02923 32.121)",
344 warning: "oklch(0.772406 0.172798 65.367)",
345 warningForeground: "oklch(0.829017 0.171221 81.038)",
346 warningSurface: "oklch(0.345524 0.046882 99.736)",
347 update: "oklch(0.796228 0.133058 157.319)",
348 updateForeground: "oklch(0.86276 0.089288 159.704)",
349 updateSurface: "oklch(0.448116 0.062637 158.86)",
350 accentSurface: "oklch(0.437021 0.060312 158.962)",
351 accentSurfaceForeground: "oklch(0.990339 0.008411 325.64)",
352 messageSurface: "oklch(0.470111 0.067221 158.676)",
353 messageForeground: "oklch(0.990339 0.008411 325.64)",
354 messageAction: "oklch(0.791603 0.129713 83.299)",
355 messageActionForeground: "oklch(0.222003 0.03479 328.979)",
356 messageActionHover: "oklch(0.815227 0.117902 84.21)",
357 codeBackground: "oklch(0.312979 0.018942 164.082)",
358 codeForeground: "oklch(0.990339 0.008411 325.64)",
359 sidebar: "oklch(0.309925 0.032827 160.944)",
360 sidebarForeground: "oklch(0.990339 0.008411 325.64)",
361 sidebarMutedForeground: "oklch(0.711387 0.007643 175.89)",
362 sidebarControlSurface: "oklch(0.432727 0.024549 163.654)",
363 sidebarRowHover: "oklch(0.374959 0.047124 159.686)",
364 sidebarRowActive: "oklch(0.41688 0.056069 159.165)",
365 sidebarRowSelected: "oklch(0.437466 0.060406 158.958)",
366 sidebarBorder: "oklch(0.569253 0.015933 167.062)",
367 terminalBackground: "oklch(0.260865 0.02152 162.75)",
368 terminalForeground: "oklch(0.990339 0.008411 325.64)",
369 terminalCursor: "oklch(0.796228 0.133058 157.319)",
370 terminalSelection: "oklch(0.464636 0.066083 158.72)",
371 terminalScrollbar: "oklch(0.594692 0.006862 176.022)",
372 terminalScrollbarHover: "oklch(0.687968 0.00354 193.55)",
373 },
374 },
375 sidebarArtwork: true,
376};
377​
378export const OCEAN_THEME: ThemeDefinition = {
379 id: "ocean",
380 label: "Ocean",
381 appearance: "light",
382 colors: {
383 canvas: "oklch(0.974199 0.002856 241.597)",
384 chrome: "oklch(0.974199 0.002856 241.597)",
385 toolbar: "oklch(0.974199 0.002856 241.597)",
386 toolbarForeground: "oklch(0.222003 0.03479 328.979)",
387 toolbarBorder: "oklch(0.91295 0.018827 241.836)",
388 toolbarControl: "oklch(0.939254 0.01193 241.729)",
389 toolbarControlForeground: "oklch(0.222003 0.03479 328.979)",
390 toolbarControlHover: "oklch(0.91295 0.018827 241.836)",
391 surface: "oklch(0.974199 0.002856 241.597)",
392 surfaceRaised: "oklch(0.951058 0.002962 258.339)",
393 surfaceOverlay: "oklch(0.934442 0.003181 269.1)",
394 text: "oklch(0.222003 0.03479 328.979)",
395 textMuted: "oklch(0.541555 0.017468 323.531)",
396 border: "oklch(0.867646 0.013482 252.362)",
397 input: "oklch(0.832939 0.017389 252.598)",
398 focus: "oklch(0.536684 0.120219 247.01)",
399 accent: "oklch(0.536684 0.120219 247.01)",
400 accentForeground: "oklch(0.990339 0.008411 325.64)",
401 secondary: "oklch(0.939254 0.01193 241.729)",
402 secondaryForeground: "oklch(0.222003 0.03479 328.979)",
403 muted: "oklch(0.948004 0.009649 241.695)",
404 mutedForeground: "oklch(0.528741 0.01828 313.823)",
405 placeholder: "oklch(0.530733 0.01795 323.79)",
406 secondaryLabel: "oklch(0.541555 0.017468 323.531)",
407 iconMuted: "oklch(0.541555 0.017468 323.531)",
408 error: "oklch(0.637823 0.237287 25.436)",
409 errorForeground: "oklch(0.509494 0.208583 28.513)",
410 errorSurface: "oklch(0.938747 0.016377 7.186)",
411 warning: "oklch(0.772406 0.172798 65.367)",
412 warningForeground: "oklch(0.546927 0.155556 45.359)",
413 warningSurface: "oklch(0.954846 0.016009 81.731)",
414 update: "oklch(0.536684 0.120219 247.01)",
415 updateForeground: "oklch(0.397497 0.084999 246.523)",
416 updateSurface: "oklch(0.904165 0.021144 241.874)",
417 accentSurface: "oklch(0.91295 0.018827 241.836)",
418 accentSurfaceForeground: "oklch(0.222003 0.03479 328.979)",
419 messageSurface: "oklch(0.895373 0.023469 241.913)",
420 messageForeground: "oklch(0.222003 0.03479 328.979)",
421 messageAction: "oklch(0.493961 0.08175 201.584)",
422 messageActionForeground: "oklch(0.990339 0.008411 325.64)",
423 messageActionHover: "oklch(0.45151 0.074407 201.516)",
424 codeBackground: "oklch(0.957684 0.002906 253.68)",
425 codeForeground: "oklch(0.222003 0.03479 328.979)",
426 sidebar: "oklch(0.939254 0.01193 241.729)",
427 sidebarForeground: "oklch(0.222003 0.03479 328.979)",
428 sidebarMutedForeground: "oklch(0.517366 0.018944 311.433)",
429 sidebarControlSurface: "oklch(0.888479 0.011475 251.638)",
430 sidebarRowHover: "oklch(0.890798 0.024681 241.933)",
431 sidebarRowActive: "oklch(0.858363 0.033325 242.089)",
432 sidebarRowSelected: "oklch(0.842113 0.037689 242.174)",
433 sidebarBorder: "oklch(0.862823 0.011384 256.926)",
434 terminalBackground: "oklch(0.974199 0.002856 241.597)",
435 terminalForeground: "oklch(0.222003 0.03479 328.979)",
436 terminalCursor: "oklch(0.536684 0.120219 247.01)",
437 terminalSelection: "oklch(0.895373 0.023469 241.913)",
438 terminalScrollbar: "oklch(0.826271 0.006191 305.456)",
439 terminalScrollbarHover: "oklch(0.756866 0.008685 313.721)",
440 },
441 variants: {
442 dark: {
443 canvas: "oklch(0.242641 0.024125 250.573)",
444 chrome: "oklch(0.242641 0.024125 250.573)",
445 toolbar: "oklch(0.242641 0.024125 250.573)",
446 toolbarForeground: "oklch(0.990339 0.008411 325.64)",
447 toolbarBorder: "oklch(0.439946 0.0561 243.479)",
448 toolbarControl: "oklch(0.358725 0.043145 244.911)",
449 toolbarControlForeground: "oklch(0.990339 0.008411 325.64)",
450 toolbarControlHover: "oklch(0.413315 0.051874 243.855)",
451 surface: "oklch(0.242641 0.024125 250.573)",
452 surfaceRaised: "oklch(0.348439 0.019942 253.696)",
453 surfaceOverlay: "oklch(0.398517 0.018232 255.72)",
454 text: "oklch(0.990339 0.008411 325.64)",
455 textMuted: "oklch(0.652227 0.01149 273.31)",
456 border: "oklch(0.438653 0.039496 245.44)",
457 input: "oklch(0.500905 0.043574 244.781)",
458 focus: "oklch(0.758933 0.105833 241.548)",
459 accent: "oklch(0.758933 0.105833 241.548)",
460 accentForeground: "oklch(0.222003 0.03479 328.979)",
461 secondary: "oklch(0.358725 0.043145 244.911)",
462 secondaryForeground: "oklch(0.990339 0.008411 325.64)",
463 muted: "oklch(0.319287 0.036766 246.065)",
464 mutedForeground: "oklch(0.691936 0.016294 261.588)",
465 placeholder: "oklch(0.721641 0.010192 281.271)",
466 secondaryLabel: "oklch(0.652227 0.01149 273.31)",
467 iconMuted: "oklch(0.652227 0.01149 273.31)",
468 error: "oklch(0.655108 0.221148 23.473)",
469 errorForeground: "oklch(0.702184 0.189226 22.228)",
470 errorSurface: "oklch(0.298933 0.036443 350.094)",
471 warning: "oklch(0.772406 0.172798 65.367)",
472 warningForeground: "oklch(0.829017 0.171221 81.038)",
473 warningSurface: "oklch(0.329449 0.028712 84.495)",
474 update: "oklch(0.758933 0.105833 241.548)",
475 updateForeground: "oklch(0.840844 0.069217 240.151)",
476 updateSurface: "oklch(0.424017 0.053575 243.695)",
477 accentSurface: "oklch(0.413315 0.051874 243.855)",
478 accentSurfaceForeground: "oklch(0.990339 0.008411 325.64)",
479 messageSurface: "oklch(0.445224 0.056936 243.413)",
480 messageForeground: "oklch(0.990339 0.008411 325.64)",
481 messageAction: "oklch(0.793363 0.105022 199.893)",
482 messageActionForeground: "oklch(0.222003 0.03479 328.979)",
483 messageActionHover: "oklch(0.815308 0.096174 199.862)",
484 codeBackground: "oklch(0.29661 0.021883 251.968)",
485 codeForeground: "oklch(0.990339 0.008411 325.64)",
486 sidebar: "oklch(0.290387 0.032043 247.274)",
487 sidebarForeground: "oklch(0.990339 0.008411 325.64)",
488 sidebarMutedForeground: "oklch(0.69099 0.01395 266.424)",
489 sidebarControlSurface: "oklch(0.417822 0.02535 250.162)",
490 sidebarRowHover: "oklch(0.353381 0.042285 245.043)",
491 sidebarRowActive: "oklch(0.393878 0.048778 244.179)",
492 sidebarRowSelected: "oklch(0.413744 0.051943 243.848)",
493 sidebarBorder: "oklch(0.55859 0.019001 256.223)",
494 terminalBackground: "oklch(0.242641 0.024125 250.573)",
495 terminalForeground: "oklch(0.990339 0.008411 325.64)",
496 terminalCursor: "oklch(0.758933 0.105833 241.548)",
497 terminalSelection: "oklch(0.439946 0.0561 243.479)",
498 terminalScrollbar: "oklch(0.58613 0.012959 267.22)",
499 terminalScrollbarHover: "oklch(0.681569 0.010909 276.465)",
500 },
501 },
502 sidebarArtwork: true,
503};
504​
505export const EMBER_THEME: ThemeDefinition = {
506 id: "ember",
507 label: "Ember",
508 appearance: "light",
509 colors: {
510 canvas: "oklch(0.976527 0.002685 60.725)",
511 chrome: "oklch(0.976527 0.002685 60.725)",
512 toolbar: "oklch(0.976527 0.002685 60.725)",
513 toolbarForeground: "oklch(0.222003 0.03479 328.979)",
514 toolbarBorder: "oklch(0.916502 0.01832 49.597)",
515 toolbarControl: "oklch(0.942267 0.01151 50.785)",
516 toolbarControlForeground: "oklch(0.222003 0.03479 328.979)",
517 toolbarControlHover: "oklch(0.916502 0.01832 49.597)",
518 surface: "oklch(0.976527 0.002685 60.725)",
519 surfaceRaised: "oklch(0.953321 0.002701 42.266)",
520 surfaceOverlay: "oklch(0.936659 0.002879 29.96)",
521 text: "oklch(0.222003 0.03479 328.979)",
522 textMuted: "oklch(0.543023 0.017316 331.964)",
523 border: "oklch(0.870631 0.013204 39.431)",
524 input: "oklch(0.836213 0.017153 38.661)",
525 focus: "oklch(0.552831 0.129438 44.656)",
526 accent: "oklch(0.552831 0.129438 44.656)",
527 accentForeground: "oklch(0.990339 0.008411 325.64)",
528 secondary: "oklch(0.942267 0.01151 50.785)",
529 secondaryForeground: "oklch(0.222003 0.03479 328.979)",
530 muted: "oklch(0.950842 0.009273 51.528)",
531 mutedForeground: "oklch(0.530413 0.018453 341.181)",
532 placeholder: "oklch(0.532339 0.017796 331.748)",
533 secondaryLabel: "oklch(0.543023 0.017316 331.964)",
534 iconMuted: "oklch(0.543023 0.017316 331.964)",
535 error: "oklch(0.637823 0.237287 25.436)",
536 errorForeground: "oklch(0.509494 0.208583 28.513)",
537 errorSurface: "oklch(0.941094 0.019938 19.375)",
538 warning: "oklch(0.772406 0.172798 65.367)",
539 warningForeground: "oklch(0.549154 0.156188 45.359)",
540 warningSurface: "oklch(0.957148 0.020843 76.702)",
541 update: "oklch(0.552831 0.129438 44.656)",
542 updateForeground: "oklch(0.408647 0.091207 45.037)",
543 updateSurface: "oklch(0.907902 0.020621 49.36)",
544 accentSurface: "oklch(0.916502 0.01832 49.597)",
545 accentSurfaceForeground: "oklch(0.222003 0.03479 328.979)",
546 messageSurface: "oklch(0.899296 0.022939 49.163)",
547 messageForeground: "oklch(0.222003 0.03479 328.979)",
548 messageAction: "oklch(0.516323 0.161628 24.82)",
549 messageActionForeground: "oklch(0.990339 0.008411 325.64)",
550 messageActionHover: "oklch(0.471223 0.145843 24.688)",
551 codeBackground: "oklch(0.959965 0.002668 47.512)",
552 codeForeground: "oklch(0.222003 0.03479 328.979)",
553 sidebar: "oklch(0.942267 0.01151 50.785)",
554 sidebarForeground: "oklch(0.222003 0.03479 328.979)",
555 sidebarMutedForeground: "oklch(0.519146 0.019214 343.427)",
556 sidebarControlSurface: "oklch(0.891332 0.011179 40.596)",
557 sidebarRowHover: "oklch(0.894819 0.024151 49.073)",
558 sidebarRowActive: "oklch(0.863104 0.032855 48.586)",
559 sidebarRowSelected: "oklch(0.84723 0.037292 48.403)",
560 sidebarBorder: "oklch(0.865593 0.011154 35.246)",
561 terminalBackground: "oklch(0.976527 0.002685 60.725)",
562 terminalForeground: "oklch(0.222003 0.03479 328.979)",
563 terminalCursor: "oklch(0.552831 0.129438 44.656)",
564 terminalSelection: "oklch(0.899296 0.022939 49.163)",
565 terminalScrollbar: "oklch(0.828185 0.005884 349.533)",
566 terminalScrollbarHover: "oklch(0.758584 0.008423 341.16)",
567 },
568 variants: {
569 dark: {
570 canvas: "oklch(0.245899 0.019144 42.044)",
571 chrome: "oklch(0.245899 0.019144 42.044)",
572 toolbar: "oklch(0.245899 0.019144 42.044)",
573 toolbarForeground: "oklch(0.990339 0.008411 325.64)",
574 toolbarBorder: "oklch(0.442681 0.0608 50.795)",
575 toolbarControl: "oklch(0.361499 0.044052 49.515)",
576 toolbarControlForeground: "oklch(0.990339 0.008411 325.64)",
577 toolbarControlHover: "oklch(0.416048 0.055354 50.484)",
578 surface: "oklch(0.245899 0.019144 42.044)",
579 surfaceRaised: "oklch(0.351262 0.01565 37.592)",
580 surfaceOverlay: "oklch(0.401111 0.014308 34.896)",
581 text: "oklch(0.990339 0.008411 325.64)",
582 textMuted: "oklch(0.654017 0.009505 13.287)",
583 border: "oklch(0.44099 0.040202 48.807)",
584 input: "oklch(0.503003 0.045721 49.44)",
585 focus: "oklch(0.762174 0.124117 52.082)",
586 accent: "oklch(0.762174 0.124117 52.082)",
587 accentForeground: "oklch(0.222003 0.03479 328.979)",
588 secondary: "oklch(0.361499 0.044052 49.515)",
589 secondaryForeground: "oklch(0.990339 0.008411 325.64)",
590 muted: "oklch(0.322144 0.03574 48.309)",
591 mutedForeground: "oklch(0.692479 0.015227 30.963)",
592 placeholder: "oklch(0.723533 0.008741 4.515)",
593 secondaryLabel: "oklch(0.654017 0.009505 13.287)",
594 iconMuted: "oklch(0.654017 0.009505 13.287)",
595 error: "oklch(0.655108 0.221148 23.473)",
596 errorForeground: "oklch(0.702184 0.189226 22.228)",
597 errorSurface: "oklch(0.310955 0.059624 24.334)",
598 warning: "oklch(0.772406 0.172798 65.367)",
599 warningForeground: "oklch(0.829017 0.171221 81.038)",
600 warningSurface: "oklch(0.339137 0.055638 66.911)",
601 update: "oklch(0.762174 0.124117 52.082)",
602 updateForeground: "oklch(0.841456 0.079585 53.521)",
603 updateSurface: "oklch(0.426749 0.057547 50.618)",
604 accentSurface: "oklch(0.416048 0.055354 50.484)",
605 accentSurfaceForeground: "oklch(0.990339 0.008411 325.64)",
606 messageSurface: "oklch(0.447961 0.061874 50.849)",
607 messageForeground: "oklch(0.990339 0.008411 325.64)",
608 messageAction: "oklch(0.747955 0.135578 29.432)",
609 messageActionForeground: "oklch(0.222003 0.03479 328.979)",
610 messageActionHover: "oklch(0.775116 0.117953 29.014)",
611 codeBackground: "oklch(0.299662 0.017229 39.973)",
612 codeForeground: "oklch(0.990339 0.008411 325.64)",
613 sidebar: "oklch(0.293349 0.029554 46.882)",
614 sidebarForeground: "oklch(0.990339 0.008411 325.64)",
615 sidebarMutedForeground: "oklch(0.691874 0.012538 24.638)",
616 sidebarControlSurface: "oklch(0.420227 0.022893 43.226)",
617 sidebarRowHover: "oklch(0.356163 0.042933 49.385)",
618 sidebarRowActive: "oklch(0.396617 0.051353 50.201)",
619 sidebarRowSelected: "oklch(0.416477 0.055442 50.489)",
620 sidebarBorder: "oklch(0.560372 0.016998 36.179)",
621 terminalBackground: "oklch(0.245899 0.019144 42.044)",
622 terminalForeground: "oklch(0.990339 0.008411 325.64)",
623 terminalCursor: "oklch(0.762174 0.124117 52.082)",
624 terminalSelection: "oklch(0.442681 0.0608 50.795)",
625 terminalScrollbar: "oklch(0.587861 0.010463 20.444)",
626 terminalScrollbarHover: "oklch(0.682876 0.009156 9.796)",
627 },
628 },
629 sidebarArtwork: true,
630};
631​
632export const IRIS_THEME: ThemeDefinition = {
633 id: "iris",
634 label: "Iris",
635 appearance: "light",
636 colors: {
637 canvas: "oklch(0.976531 0.003855 303.226)",
638 chrome: "oklch(0.976531 0.003855 303.226)",
639 toolbar: "oklch(0.976531 0.003855 303.226)",
640 toolbarForeground: "oklch(0.222003 0.03479 328.979)",
641 toolbarBorder: "oklch(0.914882 0.022965 299.986)",
642 toolbarControl: "oklch(0.941387 0.014687 300.474)",
643 toolbarControlForeground: "oklch(0.222003 0.03479 328.979)",
644 toolbarControlHover: "oklch(0.914882 0.022965 299.986)",
645 surface: "oklch(0.976531 0.003855 303.226)",
646 surfaceRaised: "oklch(0.953326 0.004536 307.676)",
647 surfaceOverlay: "oklch(0.936665 0.005041 310.132)",
648 text: "oklch(0.222003 0.03479 328.979)",
649 textMuted: "oklch(0.543042 0.018894 325.652)",
650 border: "oklch(0.869608 0.018226 303.859)",
651 input: "oklch(0.834773 0.023405 303.676)",
652 focus: "oklch(0.525348 0.15373 294.176)",
653 accent: "oklch(0.525348 0.15373 294.176)",
654 accentForeground: "oklch(0.990339 0.008411 325.64)",
655 secondary: "oklch(0.941387 0.014687 300.474)",
656 secondaryForeground: "oklch(0.222003 0.03479 328.979)",
657 muted: "oklch(0.950194 0.011956 300.733)",
658 mutedForeground: "oklch(0.529955 0.022319 321.556)",
659 placeholder: "oklch(0.532177 0.019333 325.784)",
660 secondaryLabel: "oklch(0.543042 0.018894 325.652)",
661 iconMuted: "oklch(0.543042 0.018894 325.652)",
662 error: "oklch(0.637823 0.237287 25.436)",
663 errorForeground: "oklch(0.509494 0.208583 28.513)",
664 errorSurface: "oklch(0.941043 0.019582 4.235)",
665 warning: "oklch(0.772406 0.172798 65.367)",
666 warningForeground: "oklch(0.549154 0.156188 45.359)",
667 warningSurface: "oklch(0.957054 0.016197 69.932)",
668 update: "oklch(0.525348 0.15373 294.176)",
669 updateForeground: "oklch(0.389926 0.10825 294.547)",
670 updateSurface: "oklch(0.90602 0.025754 299.867)",
671 accentSurface: "oklch(0.914882 0.022965 299.986)",
672 accentSurfaceForeground: "oklch(0.222003 0.03479 328.979)",
673 messageSurface: "oklch(0.897143 0.028558 299.758)",
674 messageForeground: "oklch(0.222003 0.03479 328.979)",
675 messageAction: "oklch(0.516084 0.185229 340.776)",
676 messageActionForeground: "oklch(0.990339 0.008411 325.64)",
677 messageActionHover: "oklch(0.471003 0.16748 340.687)",
678 codeBackground: "oklch(0.95997 0.004338 306.542)",
679 codeForeground: "oklch(0.222003 0.03479 328.979)",
680 sidebar: "oklch(0.941387 0.014687 300.474)",
681 sidebarForeground: "oklch(0.222003 0.03479 328.979)",
682 sidebarMutedForeground: "oklch(0.518417 0.023683 320.681)",
683 sidebarControlSurface: "oklch(0.890512 0.0155 303.803)",
684 sidebarRowHover: "oklch(0.892522 0.030022 299.704)",
685 sidebarRowActive: "oklch(0.85971 0.040501 299.36)",
686 sidebarRowSelected: "oklch(0.843236 0.045818 299.198)",
687 sidebarBorder: "oklch(0.864805 0.015938 305.371)",
688 terminalBackground: "oklch(0.976531 0.003855 303.226)",
689 terminalForeground: "oklch(0.222003 0.03479 328.979)",
690 terminalCursor: "oklch(0.525348 0.15373 294.176)",
691 terminalSelection: "oklch(0.897143 0.028558 299.758)",
692 terminalScrollbar: "oklch(0.828195 0.008526 318.858)",
693 terminalScrollbarHover: "oklch(0.758596 0.010892 321.538)",
694 },
695 variants: {
696 dark: {
697 canvas: "oklch(0.225975 0.031062 293.741)",
698 chrome: "oklch(0.225975 0.031062 293.741)",
699 toolbar: "oklch(0.225975 0.031062 293.741)",
700 toolbarForeground: "oklch(0.990339 0.008411 325.64)",
701 toolbarBorder: "oklch(0.395417 0.085554 294.182)",
702 toolbarControl: "oklch(0.325405 0.063614 294.23)",
703 toolbarControlForeground: "oklch(0.990339 0.008411 325.64)",
704 toolbarControlHover: "oklch(0.372436 0.07841 294.204)",
705 surface: "oklch(0.225975 0.031062 293.741)",
706 surfaceRaised: "oklch(0.335291 0.026008 296.394)",
707 surfaceOverlay: "oklch(0.386739 0.024023 297.509)",
708 text: "oklch(0.990339 0.008411 325.64)",
709 textMuted: "oklch(0.640465 0.016197 304.171)",
710 border: "oklch(0.40874 0.058536 295.893)",
711 input: "oklch(0.46756 0.065775 296.265)",
712 focus: "oklch(0.671712 0.169136 293.929)",
713 accent: "oklch(0.671712 0.169136 293.929)",
714 accentForeground: "oklch(0.222003 0.03479 328.979)",
715 secondary: "oklch(0.325405 0.063614 294.23)",
716 secondaryForeground: "oklch(0.990339 0.008411 325.64)",
717 muted: "oklch(0.291515 0.05276 294.209)",
718 mutedForeground: "oklch(0.663321 0.025932 301.862)",
719 placeholder: "oklch(0.706249 0.014508 306.607)",
720 secondaryLabel: "oklch(0.640465 0.016197 304.171)",
721 iconMuted: "oklch(0.640465 0.016197 304.171)",
722 error: "oklch(0.655108 0.221148 23.473)",
723 errorForeground: "oklch(0.702184 0.189226 22.228)",
724 errorSurface: "oklch(0.291658 0.054707 352.238)",
725 warning: "oklch(0.772406 0.172798 65.367)",
726 warningForeground: "oklch(0.829017 0.171221 81.038)",
727 warningSurface: "oklch(0.318952 0.033845 51.646)",
728 update: "oklch(0.671712 0.169136 293.929)",
729 updateForeground: "oklch(0.785032 0.108439 296.344)",
730 updateSurface: "oklch(0.381668 0.081286 294.195)",
731 accentSurface: "oklch(0.372436 0.07841 294.204)",
732 accentSurfaceForeground: "oklch(0.990339 0.008411 325.64)",
733 messageSurface: "oklch(0.399975 0.086965 294.177)",
734 messageForeground: "oklch(0.990339 0.008411 325.64)",
735 messageAction: "oklch(0.789904 0.130063 337.621)",
736 messageActionForeground: "oklch(0.222003 0.03479 328.979)",
737 messageActionHover: "oklch(0.813537 0.114101 337.23)",
738 codeBackground: "oklch(0.281873 0.028308 295.193)",
739 codeForeground: "oklch(0.990339 0.008411 325.64)",
740 sidebar: "oklch(0.266743 0.044689 294.138)",
741 sidebarForeground: "oklch(0.990339 0.008411 325.64)",
742 sidebarMutedForeground: "oklch(0.668773 0.021522 302.949)",
743 sidebarControlSurface: "oklch(0.399977 0.035678 297.031)",
744 sidebarRowHover: "oklch(0.320808 0.062152 294.23)",
745 sidebarRowActive: "oklch(0.355677 0.073167 294.217)",
746 sidebarRowSelected: "oklch(0.372806 0.078525 294.203)",
747 sidebarBorder: "oklch(0.545895 0.027522 299.871)",
748 terminalBackground: "oklch(0.225975 0.031062 293.741)",
749 terminalForeground: "oklch(0.990339 0.008411 325.64)",
750 terminalCursor: "oklch(0.671712 0.169136 293.929)",
751 terminalSelection: "oklch(0.395417 0.085554 294.182)",
752 terminalScrollbar: "oklch(0.578663 0.017888 302.229)",
753 terminalScrollbarHover: "oklch(0.676012 0.015271 305.433)",
754 },
755 },
756 sidebarArtwork: true,
757};
758​
759export const BUILT_IN_THEMES: ReadonlyArray<ThemeDefinition> = [
760 T3_CHAT_THEME,
761 GROVE_THEME,
762 OCEAN_THEME,
763 EMBER_THEME,
764 IRIS_THEME,
765];
766​
767export function getThemeColorsForAppearance(
768 theme: ThemeDefinition,
769 appearance: ThemeAppearance,
770): ThemeColors | null {
771 if (theme.appearance === appearance) return theme.colors;
772 return theme.variants?.[appearance] ?? null;