1use gpui::*;
2use std::time::Duration;
3
4use crate::capabilities::foundation::fonts::{UI_FONT_FAMILY, UI_MONO_FONT_FAMILY};
5
6#[derive(Clone, Debug)]
8pub struct ThemeTokens {
9 pub background: Hsla,
10 pub foreground: Hsla,
11 pub card: Hsla,
12 pub card_foreground: Hsla,
13 pub popover: Hsla,
14 pub popover_foreground: Hsla,
15 pub muted: Hsla,
16 pub muted_foreground: Hsla,
17 pub accent: Hsla,
18 pub accent_foreground: Hsla,
19 pub primary: Hsla,
20 pub primary_foreground: Hsla,
21 pub secondary: Hsla,
22 pub secondary_foreground: Hsla,
23 pub destructive: Hsla,
24 pub destructive_foreground: Hsla,
25 pub border: Hsla,
26 pub input: Hsla,
27 pub ring: Hsla,
28
29 pub radius_sm: Pixels,
30 pub radius_md: Pixels,
31 pub radius_lg: Pixels,
32 pub radius_xl: Pixels,
33
34 pub shadow_xs: BoxShadow,
35 pub shadow_sm: BoxShadow,
36 pub shadow_md: BoxShadow,
37 pub shadow_lg: BoxShadow,
38 pub shadow_xl: BoxShadow,
39
40 pub ring_offset: Pixels,
41
42 pub transition_fast: Duration,
43 pub transition_base: Duration,
44 pub transition_slow: Duration,
45
46 pub font_family: SharedString,
47 pub font_mono: SharedString,
48
49 pub spacing_1: Pixels,
50 pub spacing_2: Pixels,
51 pub spacing_3: Pixels,
52 pub spacing_4: Pixels,
53 pub spacing_5: Pixels,
54 pub spacing_6: Pixels,
55 pub spacing_8: Pixels,
56 pub spacing_10: Pixels,
57 pub spacing_12: Pixels,
58 pub spacing_16: Pixels,
59
60 pub duration_fastest: Duration,
61 pub duration_faster: Duration,
62 pub duration_fast: Duration,
63 pub duration_normal: Duration,
64 pub duration_slow: Duration,
65 pub duration_slower: Duration,
66 pub duration_slowest: Duration,
67
68 pub z_dropdown: u32,
69 pub z_sticky: u32,
70 pub z_modal: u32,
71 pub z_popover: u32,
72 pub z_tooltip: u32,
73
74 pub text_xs: Pixels,
76 pub text_sm: Pixels,
77 pub text_base: Pixels,
78 pub text_lg: Pixels,
79 pub text_xl: Pixels,
80 pub text_2xl: Pixels,
81 pub text_3xl: Pixels,
82 pub text_4xl: Pixels,
83 pub text_5xl: Pixels,
84
85 pub leading_none: f32,
87 pub leading_tight: f32,
88 pub leading_snug: f32,
89 pub leading_normal: f32,
90 pub leading_relaxed: f32,
91 pub leading_loose: f32,
92}
93
94impl Default for ThemeTokens {
95 fn default() -> Self {
99 Self::light()
100 }
101}
102
103impl ThemeTokens {
104 fn standard_spacing_duration_z() -> (
105 Pixels,
106 Pixels,
107 Pixels,
108 Pixels,
109 Pixels,
110 Pixels,
111 Pixels,
112 Pixels,
113 Pixels,
114 Pixels,
115 Duration,
116 Duration,
117 Duration,
118 Duration,
119 Duration,
120 Duration,
121 Duration,
122 u32,
123 u32,
124 u32,
125 u32,
126 u32,
127 ) {
128 (
129 px(4.0),
130 px(8.0),
131 px(12.0),
132 px(16.0),
133 px(20.0),
134 px(24.0),
135 px(32.0),
136 px(40.0),
137 px(48.0),
138 px(64.0),
139 Duration::from_millis(50),
140 Duration::from_millis(100),
141 Duration::from_millis(150),
142 Duration::from_millis(200),
143 Duration::from_millis(300),
144 Duration::from_millis(400),
145 Duration::from_millis(500),
146 1000,
148 900,
150 1300,
151 1400,
152 1500,
153 )
154 }
155
156 fn apply_standard(mut self) -> Self {
157 let (
158 s1,
159 s2,
160 s3,
161 s4,
162 s5,
163 s6,
164 s8,
165 s10,
166 s12,
167 s16,
168 df,
169 dfr,
170 dfa,
171 dn,
172 ds,
173 dsr,
174 dst,
175 zd,
176 zs,
177 zm,
178 zp,
179 zt,
180 ) = Self::standard_spacing_duration_z();
181 self.spacing_1 = s1;
182 self.spacing_2 = s2;
183 self.spacing_3 = s3;
184 self.spacing_4 = s4;
185 self.spacing_5 = s5;
186 self.spacing_6 = s6;
187 self.spacing_8 = s8;
188 self.spacing_10 = s10;
189 self.spacing_12 = s12;
190 self.spacing_16 = s16;
191 self.duration_fastest = df;
192 self.duration_faster = dfr;
193 self.duration_fast = dfa;
194 self.duration_normal = dn;
195 self.duration_slow = ds;
196 self.duration_slower = dsr;
197 self.duration_slowest = dst;
198 self.z_dropdown = zd;
199 self.z_sticky = zs;
200 self.z_modal = zm;
201 self.z_popover = zp;
202 self.z_tooltip = zt;
203
204 self.text_xs = px(12.0);
205 self.text_sm = px(14.0);
206 self.text_base = px(16.0);
207 self.text_lg = px(18.0);
208 self.text_xl = px(20.0);
209 self.text_2xl = px(24.0);
210 self.text_3xl = px(30.0);
211 self.text_4xl = px(36.0);
212 self.text_5xl = px(48.0);
213
214 self.leading_none = 1.0;
215 self.leading_tight = 1.25;
216 self.leading_snug = 1.375;
217 self.leading_normal = 1.5;
218 self.leading_relaxed = 1.625;
219 self.leading_loose = 2.0;
220 self
221 }
222
223 pub fn light() -> Self {
224 Self {
225 background: rgb(0xffffff).into(),
226 foreground: rgb(0x0a0a0a).into(),
227 card: rgb(0xffffff).into(),
228 card_foreground: rgb(0x0a0a0a).into(),
229 popover: rgb(0xffffff).into(),
230 popover_foreground: rgb(0x0a0a0a).into(),
231 muted: rgb(0xf5f5f5).into(),
232 muted_foreground: rgb(0x737373).into(),
233 accent: rgb(0xf5f5f5).into(),
234 accent_foreground: rgb(0x0a0a0a).into(),
235 primary: rgb(0x000000).into(),
236 primary_foreground: rgb(0xffffff).into(),
237 secondary: rgb(0xf5f5f5).into(),
238 secondary_foreground: rgb(0x0a0a0a).into(),
239 destructive: rgb(0xef4444).into(),
240 destructive_foreground: rgb(0xffffff).into(),
241 border: rgb(0xe5e5e5).into(),
242 input: rgb(0xe5e5e5).into(),
243 ring: rgb(0xd4d4d8).into(),
244
245 radius_sm: px(4.0),
246 radius_md: px(6.0),
247 radius_lg: px(8.0),
248 radius_xl: px(12.0),
249
250 shadow_xs: BoxShadow {
251 offset: point(px(0.0), px(1.0)),
252 blur_radius: px(2.0),
253 spread_radius: px(0.0),
254 inset: false,
255 color: hsla(0.0, 0.0, 0.0, 0.05),
256 },
257 shadow_sm: BoxShadow {
258 offset: point(px(0.0), px(1.0)),
259 blur_radius: px(3.0),
260 spread_radius: px(0.0),
261 inset: false,
262 color: hsla(0.0, 0.0, 0.0, 0.1),
263 },
264 shadow_md: BoxShadow {
265 offset: point(px(0.0), px(4.0)),
266 blur_radius: px(6.0),
267 spread_radius: px(-1.0),
268 inset: false,
269 color: hsla(0.0, 0.0, 0.0, 0.1),
270 },
271 shadow_lg: BoxShadow {
272 offset: point(px(0.0), px(10.0)),
273 blur_radius: px(15.0),
274 spread_radius: px(-3.0),
275 inset: false,
276 color: hsla(0.0, 0.0, 0.0, 0.1),
277 },
278 shadow_xl: BoxShadow {
279 offset: point(px(0.0), px(20.0)),
280 blur_radius: px(25.0),
281 spread_radius: px(-5.0),
282 inset: false,
283 color: hsla(0.0, 0.0, 0.0, 0.1),
284 },
285
286 ring_offset: px(2.0),
287
288 transition_fast: Duration::from_millis(150),
289 transition_base: Duration::from_millis(200),
290 transition_slow: Duration::from_millis(300),
291
292 font_family: UI_FONT_FAMILY.into(),
293 font_mono: UI_MONO_FONT_FAMILY.into(),
294
295 spacing_1: px(0.0),
296 spacing_2: px(0.0),
297 spacing_3: px(0.0),
298 spacing_4: px(0.0),
299 spacing_5: px(0.0),
300 spacing_6: px(0.0),
301 spacing_8: px(0.0),
302 spacing_10: px(0.0),
303 spacing_12: px(0.0),
304 spacing_16: px(0.0),
305 duration_fastest: Duration::ZERO,
306 duration_faster: Duration::ZERO,
307 duration_fast: Duration::ZERO,
308 duration_normal: Duration::ZERO,
309 duration_slow: Duration::ZERO,
310 duration_slower: Duration::ZERO,
311 duration_slowest: Duration::ZERO,
312 z_dropdown: 0,
313 z_sticky: 0,
314 z_modal: 0,
315 z_popover: 0,
316 z_tooltip: 0,
317 text_xs: px(0.0),
318 text_sm: px(0.0),
319 text_base: px(0.0),
320 text_lg: px(0.0),
321 text_xl: px(0.0),
322 text_2xl: px(0.0),
323 text_3xl: px(0.0),
324 text_4xl: px(0.0),
325 text_5xl: px(0.0),
326 leading_none: 0.0,
327 leading_tight: 0.0,
328 leading_snug: 0.0,
329 leading_normal: 0.0,
330 leading_relaxed: 0.0,
331 leading_loose: 0.0,
332 }
333 .apply_standard()
334 }
335
336 pub fn dark() -> Self {
337 Self {
338 background: rgb(0x000000).into(),
339 foreground: rgb(0xf5f5f5).into(),
340 card: rgb(0x0a0a0a).into(),
341 card_foreground: rgb(0xf5f5f5).into(),
342 popover: rgb(0x0a0a0a).into(),
343 popover_foreground: rgb(0xf5f5f5).into(),
344 muted: rgb(0x1a1a1a).into(),
345 muted_foreground: rgb(0x737373).into(),
346 accent: rgb(0x262626).into(),
347 accent_foreground: rgb(0xffffff).into(),
348 primary: rgb(0xffffff).into(),
349 primary_foreground: rgb(0x000000).into(),
350 secondary: rgb(0x262626).into(),
351 secondary_foreground: rgb(0xf5f5f5).into(),
352 destructive: rgb(0xff4444).into(),
353 destructive_foreground: rgb(0xffffff).into(),
354 border: rgb(0x333333).into(),
355 input: rgb(0x333333).into(),
356 ring: rgb(0xffffff).into(),
357
358 radius_sm: px(4.0),
359 radius_md: px(6.0),
360 radius_lg: px(8.0),
361 radius_xl: px(12.0),
362
363 shadow_xs: BoxShadow {
364 offset: point(px(0.0), px(1.0)),
365 blur_radius: px(2.0),
366 spread_radius: px(0.0),
367 inset: false,
368 color: hsla(0.0, 0.0, 0.0, 0.5),
369 },
370 shadow_sm: BoxShadow {
371 offset: point(px(0.0), px(1.0)),
372 blur_radius: px(3.0),
373 spread_radius: px(0.0),
374 inset: false,
375 color: hsla(0.0, 0.0, 0.0, 0.6),
376 },
377 shadow_md: BoxShadow {
378 offset: point(px(0.0), px(4.0)),
379 blur_radius: px(6.0),
380 spread_radius: px(-1.0),
381 inset: false,
382 color: hsla(0.0, 0.0, 0.0, 0.7),
383 },
384 shadow_lg: BoxShadow {
385 offset: point(px(0.0), px(10.0)),
386 blur_radius: px(15.0),
387 spread_radius: px(-3.0),
388 inset: false,
389 color: hsla(0.0, 0.0, 0.0, 0.8),
390 },
391 shadow_xl: BoxShadow {
392 offset: point(px(0.0), px(20.0)),
393 blur_radius: px(25.0),
394 spread_radius: px(-5.0),
395 inset: false,
396 color: hsla(0.0, 0.0, 0.0, 0.9),
397 },
398
399 ring_offset: px(2.0),
400
401 transition_fast: Duration::from_millis(150),
402 transition_base: Duration::from_millis(200),
403 transition_slow: Duration::from_millis(300),
404
405 font_family: UI_FONT_FAMILY.into(),
406 font_mono: UI_MONO_FONT_FAMILY.into(),
407
408 ..Default::default()
409 }
410 .apply_standard()
411 }
412
413 pub fn midnight_blue() -> Self {
414 Self {
415 background: rgb(0x0a0f14).into(), foreground: rgb(0xe6edf3).into(),
417 card: rgb(0x0f1419).into(),
418 card_foreground: rgb(0xe6edf3).into(),
419 popover: rgb(0x0f1419).into(),
420 popover_foreground: rgb(0xe6edf3).into(),
421 muted: rgb(0x161b22).into(),
422 muted_foreground: rgb(0x6e7681).into(),
423 accent: rgb(0x1e3a8a).into(),
424 accent_foreground: rgb(0x60a5fa).into(),
425 primary: rgb(0x60a5fa).into(), primary_foreground: rgb(0x0a0f14).into(),
427 secondary: rgb(0x1e293b).into(),
428 secondary_foreground: rgb(0xe2e8f0).into(),
429 destructive: rgb(0xef4444).into(),
430 destructive_foreground: rgb(0xffffff).into(),
431 border: rgb(0x21262d).into(),
432 input: rgb(0x21262d).into(),
433 ring: rgb(0x60a5fa).into(),
434
435 radius_sm: px(4.0),
436 radius_md: px(6.0),
437 radius_lg: px(8.0),
438 radius_xl: px(12.0),
439
440 shadow_xs: BoxShadow {
441 offset: point(px(0.0), px(1.0)),
442 blur_radius: px(2.0),
443 spread_radius: px(0.0),
444 inset: false,
445 color: hsla(0.0, 0.0, 0.0, 0.15),
446 },
447 shadow_sm: BoxShadow {
448 offset: point(px(0.0), px(1.0)),
449 blur_radius: px(3.0),
450 spread_radius: px(0.0),
451 inset: false,
452 color: hsla(0.0, 0.0, 0.0, 0.2),
453 },
454 shadow_md: BoxShadow {
455 offset: point(px(0.0), px(4.0)),
456 blur_radius: px(6.0),
457 spread_radius: px(-1.0),
458 inset: false,
459 color: hsla(0.0, 0.0, 0.0, 0.15),
460 },
461 shadow_lg: BoxShadow {
462 offset: point(px(0.0), px(10.0)),
463 blur_radius: px(15.0),
464 spread_radius: px(-3.0),
465 inset: false,
466 color: hsla(0.0, 0.0, 0.0, 0.15),
467 },
468 shadow_xl: BoxShadow {
469 offset: point(px(0.0), px(20.0)),
470 blur_radius: px(25.0),
471 spread_radius: px(-5.0),
472 inset: false,
473 color: hsla(0.0, 0.0, 0.0, 0.15),
474 },
475
476 ring_offset: px(2.0),
477
478 transition_fast: Duration::from_millis(150),
479 transition_base: Duration::from_millis(200),
480 transition_slow: Duration::from_millis(300),
481
482 font_family: UI_FONT_FAMILY.into(),
483 font_mono: UI_MONO_FONT_FAMILY.into(),
484
485 ..Default::default()
486 }
487 .apply_standard()
488 }
489
490 pub fn forest_grove() -> Self {
491 Self {
492 background: rgb(0x0a0e0b).into(), foreground: rgb(0xd4e5d4).into(),
494 card: rgb(0x0f1410).into(),
495 card_foreground: rgb(0xd4e5d4).into(),
496 popover: rgb(0x0f1410).into(),
497 popover_foreground: rgb(0xd4e5d4).into(),
498 muted: rgb(0x141a15).into(),
499 muted_foreground: rgb(0x6b7a6b).into(),
500 accent: rgb(0x14532d).into(),
501 accent_foreground: rgb(0x4ade80).into(),
502 primary: rgb(0x4ade80).into(), primary_foreground: rgb(0x0a0e0b).into(),
504 secondary: rgb(0x1e3a26).into(),
505 secondary_foreground: rgb(0xbbf7d0).into(),
506 destructive: rgb(0xf87171).into(),
507 destructive_foreground: rgb(0xffffff).into(),
508 border: rgb(0x1a2520).into(),
509 input: rgb(0x1a2520).into(),
510 ring: rgb(0x4ade80).into(),
511
512 radius_sm: px(4.0),
513 radius_md: px(6.0),
514 radius_lg: px(8.0),
515 radius_xl: px(12.0),
516
517 shadow_xs: BoxShadow {
518 offset: point(px(0.0), px(1.0)),
519 blur_radius: px(2.0),
520 spread_radius: px(0.0),
521 inset: false,
522 color: hsla(0.0, 0.0, 0.0, 0.15),
523 },
524 shadow_sm: BoxShadow {
525 offset: point(px(0.0), px(1.0)),
526 blur_radius: px(3.0),
527 spread_radius: px(0.0),
528 inset: false,
529 color: hsla(0.0, 0.0, 0.0, 0.2),
530 },
531 shadow_md: BoxShadow {
532 offset: point(px(0.0), px(4.0)),
533 blur_radius: px(6.0),
534 spread_radius: px(-1.0),
535 inset: false,
536 color: hsla(0.0, 0.0, 0.0, 0.15),
537 },
538 shadow_lg: BoxShadow {
539 offset: point(px(0.0), px(10.0)),
540 blur_radius: px(15.0),
541 spread_radius: px(-3.0),
542 inset: false,
543 color: hsla(0.0, 0.0, 0.0, 0.15),
544 },
545 shadow_xl: BoxShadow {
546 offset: point(px(0.0), px(20.0)),
547 blur_radius: px(25.0),
548 spread_radius: px(-5.0),
549 inset: false,
550 color: hsla(0.0, 0.0, 0.0, 0.15),
551 },
552
553 ring_offset: px(2.0),
554
555 transition_fast: Duration::from_millis(150),
556 transition_base: Duration::from_millis(200),
557 transition_slow: Duration::from_millis(300),
558
559 font_family: UI_FONT_FAMILY.into(),
560 font_mono: UI_MONO_FONT_FAMILY.into(),
561
562 ..Default::default()
563 }
564 .apply_standard()
565 }
566
567 pub fn sunset_amber() -> Self {
568 Self {
569 background: rgb(0x140a05).into(), foreground: rgb(0xfef3c7).into(),
571 card: rgb(0x1c0f08).into(),
572 card_foreground: rgb(0xfef3c7).into(),
573 popover: rgb(0x1c0f08).into(),
574 popover_foreground: rgb(0xfef3c7).into(),
575 muted: rgb(0x2a1810).into(),
576 muted_foreground: rgb(0x9d7c5a).into(),
577 accent: rgb(0x7c2d12).into(),
578 accent_foreground: rgb(0xfbbf24).into(),
579 primary: rgb(0xfbbf24).into(), primary_foreground: rgb(0x140a05).into(),
581 secondary: rgb(0x4c1d95).into(),
582 secondary_foreground: rgb(0xe9d5ff).into(),
583 destructive: rgb(0xef4444).into(),
584 destructive_foreground: rgb(0xffffff).into(),
585 border: rgb(0x3a2415).into(),
586 input: rgb(0x3a2415).into(),
587 ring: rgb(0xfbbf24).into(),
588
589 radius_sm: px(4.0),
590 radius_md: px(6.0),
591 radius_lg: px(8.0),
592 radius_xl: px(12.0),
593
594 shadow_xs: BoxShadow {
595 offset: point(px(0.0), px(1.0)),
596 blur_radius: px(2.0),
597 spread_radius: px(0.0),
598 inset: false,
599 color: hsla(0.0, 0.0, 0.0, 0.15),
600 },
601 shadow_sm: BoxShadow {
602 offset: point(px(0.0), px(1.0)),
603 blur_radius: px(3.0),
604 spread_radius: px(0.0),
605 inset: false,
606 color: hsla(0.0, 0.0, 0.0, 0.2),
607 },
608 shadow_md: BoxShadow {
609 offset: point(px(0.0), px(4.0)),
610 blur_radius: px(6.0),
611 spread_radius: px(-1.0),
612 inset: false,
613 color: hsla(0.0, 0.0, 0.0, 0.15),
614 },
615 shadow_lg: BoxShadow {
616 offset: point(px(0.0), px(10.0)),
617 blur_radius: px(15.0),
618 spread_radius: px(-3.0),
619 inset: false,
620 color: hsla(0.0, 0.0, 0.0, 0.15),
621 },
622 shadow_xl: BoxShadow {
623 offset: point(px(0.0), px(20.0)),
624 blur_radius: px(25.0),
625 spread_radius: px(-5.0),
626 inset: false,
627 color: hsla(0.0, 0.0, 0.0, 0.15),
628 },
629
630 ring_offset: px(2.0),
631
632 transition_fast: Duration::from_millis(150),
633 transition_base: Duration::from_millis(200),
634 transition_slow: Duration::from_millis(300),
635
636 font_family: UI_FONT_FAMILY.into(),
637 font_mono: UI_MONO_FONT_FAMILY.into(),
638
639 ..Default::default()
640 }
641 .apply_standard()
642 }
643
644 pub fn ocean_breeze() -> Self {
645 Self {
646 background: rgb(0x051018).into(), foreground: rgb(0xe3f2fd).into(),
648 card: rgb(0x0a1929).into(),
649 card_foreground: rgb(0xe3f2fd).into(),
650 popover: rgb(0x0a1929).into(),
651 popover_foreground: rgb(0xe3f2fd).into(),
652 muted: rgb(0x0f2638).into(),
653 muted_foreground: rgb(0x67a3b8).into(),
654 accent: rgb(0x0e7490).into(),
655 accent_foreground: rgb(0x22d3ee).into(),
656 primary: rgb(0x22d3ee).into(), primary_foreground: rgb(0x051018).into(),
658 secondary: rgb(0x0284c7).into(),
659 secondary_foreground: rgb(0xe0f2fe).into(),
660 destructive: rgb(0xf87171).into(),
661 destructive_foreground: rgb(0xffffff).into(),
662 border: rgb(0x0f2638).into(),
663 input: rgb(0x0f2638).into(),
664 ring: rgb(0x22d3ee).into(),
665
666 radius_sm: px(4.0),
667 radius_md: px(6.0),
668 radius_lg: px(8.0),
669 radius_xl: px(12.0),
670
671 shadow_xs: BoxShadow {
672 offset: point(px(0.0), px(1.0)),
673 blur_radius: px(2.0),
674 spread_radius: px(0.0),
675 inset: false,
676 color: hsla(0.0, 0.0, 0.0, 0.15),
677 },
678 shadow_sm: BoxShadow {
679 offset: point(px(0.0), px(1.0)),
680 blur_radius: px(3.0),
681 spread_radius: px(0.0),
682 inset: false,
683 color: hsla(0.0, 0.0, 0.0, 0.2),
684 },
685 shadow_md: BoxShadow {
686 offset: point(px(0.0), px(4.0)),
687 blur_radius: px(6.0),
688 spread_radius: px(-1.0),
689 inset: false,
690 color: hsla(0.0, 0.0, 0.0, 0.15),
691 },
692 shadow_lg: BoxShadow {
693 offset: point(px(0.0), px(10.0)),
694 blur_radius: px(15.0),
695 spread_radius: px(-3.0),
696 inset: false,
697 color: hsla(0.0, 0.0, 0.0, 0.15),
698 },
699 shadow_xl: BoxShadow {
700 offset: point(px(0.0), px(20.0)),
701 blur_radius: px(25.0),
702 spread_radius: px(-5.0),
703 inset: false,
704 color: hsla(0.0, 0.0, 0.0, 0.15),
705 },
706
707 ring_offset: px(2.0),
708
709 transition_fast: Duration::from_millis(150),
710 transition_base: Duration::from_millis(200),
711 transition_slow: Duration::from_millis(300),
712
713 font_family: UI_FONT_FAMILY.into(),
714 font_mono: UI_MONO_FONT_FAMILY.into(),
715
716 ..Default::default()
717 }
718 .apply_standard()
719 }
720
721 pub fn dracula() -> Self {
722 Self {
723 background: rgb(0x1e1f29).into(), foreground: rgb(0xf8f8f2).into(),
725 card: rgb(0x282a36).into(),
726 card_foreground: rgb(0xf8f8f2).into(),
727 popover: rgb(0x282a36).into(),
728 popover_foreground: rgb(0xf8f8f2).into(),
729 muted: rgb(0x44475a).into(),
730 muted_foreground: rgb(0x6272a4).into(),
731 accent: rgb(0x44475a).into(),
732 accent_foreground: rgb(0xf8f8f2).into(),
733 primary: rgb(0xc9a9ff).into(), primary_foreground: rgb(0x1e1f29).into(),
735 secondary: rgb(0x44475a).into(),
736 secondary_foreground: rgb(0xf8f8f2).into(),
737 destructive: rgb(0xff6e6e).into(),
738 destructive_foreground: rgb(0xf8f8f2).into(),
739 border: rgb(0x3a3c4e).into(),
740 input: rgb(0x3a3c4e).into(),
741 ring: rgb(0xc9a9ff).into(),
742
743 radius_sm: px(4.0),
744 radius_md: px(6.0),
745 radius_lg: px(8.0),
746 radius_xl: px(12.0),
747
748 shadow_xs: BoxShadow {
749 offset: point(px(0.0), px(1.0)),
750 blur_radius: px(2.0),
751 spread_radius: px(0.0),
752 inset: false,
753 color: hsla(0.0, 0.0, 0.0, 0.15),
754 },
755 shadow_sm: BoxShadow {
756 offset: point(px(0.0), px(1.0)),
757 blur_radius: px(3.0),
758 spread_radius: px(0.0),
759 inset: false,
760 color: hsla(0.0, 0.0, 0.0, 0.2),
761 },
762 shadow_md: BoxShadow {
763 offset: point(px(0.0), px(4.0)),
764 blur_radius: px(6.0),
765 spread_radius: px(-1.0),
766 inset: false,
767 color: hsla(0.0, 0.0, 0.0, 0.15),
768 },
769 shadow_lg: BoxShadow {
770 offset: point(px(0.0), px(10.0)),
771 blur_radius: px(15.0),
772 spread_radius: px(-3.0),
773 inset: false,
774 color: hsla(0.0, 0.0, 0.0, 0.15),
775 },
776 shadow_xl: BoxShadow {
777 offset: point(px(0.0), px(20.0)),
778 blur_radius: px(25.0),
779 spread_radius: px(-5.0),
780 inset: false,
781 color: hsla(0.0, 0.0, 0.0, 0.15),
782 },
783
784 ring_offset: px(2.0),
785
786 transition_fast: Duration::from_millis(150),
787 transition_base: Duration::from_millis(200),
788 transition_slow: Duration::from_millis(300),
789
790 font_family: UI_FONT_FAMILY.into(),
791 font_mono: UI_MONO_FONT_FAMILY.into(),
792
793 ..Default::default()
794 }
795 .apply_standard()
796 }
797
798 pub fn nord() -> Self {
799 Self {
800 background: rgb(0x242933).into(), foreground: rgb(0xeceff4).into(),
802 card: rgb(0x2e3440).into(),
803 card_foreground: rgb(0xeceff4).into(),
804 popover: rgb(0x2e3440).into(),
805 popover_foreground: rgb(0xeceff4).into(),
806 muted: rgb(0x3b4252).into(),
807 muted_foreground: rgb(0x81a1c1).into(),
808 accent: rgb(0x434c5e).into(),
809 accent_foreground: rgb(0x8fbcbb).into(),
810 primary: rgb(0x8fbcbb).into(), primary_foreground: rgb(0x242933).into(),
812 secondary: rgb(0x5e81ac).into(),
813 secondary_foreground: rgb(0xeceff4).into(),
814 destructive: rgb(0xbf616a).into(),
815 destructive_foreground: rgb(0xeceff4).into(),
816 border: rgb(0x3b4252).into(),
817 input: rgb(0x3b4252).into(),
818 ring: rgb(0x8fbcbb).into(),
819
820 radius_sm: px(4.0),
821 radius_md: px(6.0),
822 radius_lg: px(8.0),
823 radius_xl: px(12.0),
824
825 shadow_xs: BoxShadow {
826 offset: point(px(0.0), px(1.0)),
827 blur_radius: px(2.0),
828 spread_radius: px(0.0),
829 inset: false,
830 color: hsla(0.0, 0.0, 0.0, 0.15),
831 },
832 shadow_sm: BoxShadow {
833 offset: point(px(0.0), px(1.0)),
834 blur_radius: px(3.0),
835 spread_radius: px(0.0),
836 inset: false,
837 color: hsla(0.0, 0.0, 0.0, 0.2),
838 },
839 shadow_md: BoxShadow {
840 offset: point(px(0.0), px(4.0)),
841 blur_radius: px(6.0),
842 spread_radius: px(-1.0),
843 inset: false,
844 color: hsla(0.0, 0.0, 0.0, 0.15),
845 },
846 shadow_lg: BoxShadow {
847 offset: point(px(0.0), px(10.0)),
848 blur_radius: px(15.0),
849 spread_radius: px(-3.0),
850 inset: false,
851 color: hsla(0.0, 0.0, 0.0, 0.15),
852 },
853 shadow_xl: BoxShadow {
854 offset: point(px(0.0), px(20.0)),
855 blur_radius: px(25.0),
856 spread_radius: px(-5.0),
857 inset: false,
858 color: hsla(0.0, 0.0, 0.0, 0.15),
859 },
860
861 ring_offset: px(2.0),
862
863 transition_fast: Duration::from_millis(150),
864 transition_base: Duration::from_millis(200),
865 transition_slow: Duration::from_millis(300),
866
867 font_family: UI_FONT_FAMILY.into(),
868 font_mono: UI_MONO_FONT_FAMILY.into(),
869
870 ..Default::default()
871 }
872 .apply_standard()
873 }
874
875 pub fn monokai_pro() -> Self {
876 Self {
877 background: rgb(0x221f22).into(), foreground: rgb(0xfcfcfa).into(),
879 card: rgb(0x2d2a2e).into(),
880 card_foreground: rgb(0xfcfcfa).into(),
881 popover: rgb(0x2d2a2e).into(),
882 popover_foreground: rgb(0xfcfcfa).into(),
883 muted: rgb(0x403e41).into(),
884 muted_foreground: rgb(0x939293).into(),
885 accent: rgb(0x5b595c).into(),
886 accent_foreground: rgb(0xfcfcfa).into(),
887 primary: rgb(0xffe66d).into(), primary_foreground: rgb(0x221f22).into(),
889 secondary: rgb(0x5b595c).into(),
890 secondary_foreground: rgb(0xfcfcfa).into(),
891 destructive: rgb(0xff6e97).into(),
892 destructive_foreground: rgb(0xfcfcfa).into(),
893 border: rgb(0x403e41).into(),
894 input: rgb(0x403e41).into(),
895 ring: rgb(0xffe66d).into(),
896
897 radius_sm: px(4.0),
898 radius_md: px(6.0),
899 radius_lg: px(8.0),
900 radius_xl: px(12.0),
901
902 shadow_xs: BoxShadow {
903 offset: point(px(0.0), px(1.0)),
904 blur_radius: px(2.0),
905 spread_radius: px(0.0),
906 inset: false,
907 color: hsla(0.0, 0.0, 0.0, 0.15),
908 },
909 shadow_sm: BoxShadow {
910 offset: point(px(0.0), px(1.0)),
911 blur_radius: px(3.0),
912 spread_radius: px(0.0),
913 inset: false,
914 color: hsla(0.0, 0.0, 0.0, 0.2),
915 },
916 shadow_md: BoxShadow {
917 offset: point(px(0.0), px(4.0)),
918 blur_radius: px(6.0),
919 spread_radius: px(-1.0),
920 inset: false,
921 color: hsla(0.0, 0.0, 0.0, 0.15),
922 },
923 shadow_lg: BoxShadow {
924 offset: point(px(0.0), px(10.0)),
925 blur_radius: px(15.0),
926 spread_radius: px(-3.0),
927 inset: false,
928 color: hsla(0.0, 0.0, 0.0, 0.15),
929 },
930 shadow_xl: BoxShadow {
931 offset: point(px(0.0), px(20.0)),
932 blur_radius: px(25.0),
933 spread_radius: px(-5.0),
934 inset: false,
935 color: hsla(0.0, 0.0, 0.0, 0.15),
936 },
937
938 ring_offset: px(2.0),
939
940 transition_fast: Duration::from_millis(150),
941 transition_base: Duration::from_millis(200),
942 transition_slow: Duration::from_millis(300),
943
944 font_family: UI_FONT_FAMILY.into(),
945 font_mono: UI_MONO_FONT_FAMILY.into(),
946
947 ..Default::default()
948 }
949 .apply_standard()
950 }
951
952 pub fn tokyo_night() -> Self {
953 Self {
954 background: rgb(0x16161e).into(), foreground: rgb(0xc0caf5).into(),
956 card: rgb(0x1a1b26).into(),
957 card_foreground: rgb(0xc0caf5).into(),
958 popover: rgb(0x1a1b26).into(),
959 popover_foreground: rgb(0xc0caf5).into(),
960 muted: rgb(0x1f2335).into(),
961 muted_foreground: rgb(0x565f89).into(),
962 accent: rgb(0x292e42).into(),
963 accent_foreground: rgb(0x7aa2f7).into(),
964 primary: rgb(0x7dcfff).into(), primary_foreground: rgb(0x16161e).into(),
966 secondary: rgb(0x292e42).into(),
967 secondary_foreground: rgb(0xc0caf5).into(),
968 destructive: rgb(0xf7768e).into(),
969 destructive_foreground: rgb(0xc0caf5).into(),
970 border: rgb(0x292e42).into(),
971 input: rgb(0x292e42).into(),
972 ring: rgb(0x7dcfff).into(),
973
974 radius_sm: px(4.0),
975 radius_md: px(6.0),
976 radius_lg: px(8.0),
977 radius_xl: px(12.0),
978
979 shadow_xs: BoxShadow {
980 offset: point(px(0.0), px(1.0)),
981 blur_radius: px(2.0),
982 spread_radius: px(0.0),
983 inset: false,
984 color: hsla(0.0, 0.0, 0.0, 0.15),
985 },
986 shadow_sm: BoxShadow {
987 offset: point(px(0.0), px(1.0)),
988 blur_radius: px(3.0),
989 spread_radius: px(0.0),
990 inset: false,
991 color: hsla(0.0, 0.0, 0.0, 0.2),
992 },
993 shadow_md: BoxShadow {
994 offset: point(px(0.0), px(4.0)),
995 blur_radius: px(6.0),
996 spread_radius: px(-1.0),
997 inset: false,
998 color: hsla(0.0, 0.0, 0.0, 0.15),
999 },
1000 shadow_lg: BoxShadow {
1001 offset: point(px(0.0), px(10.0)),
1002 blur_radius: px(15.0),
1003 spread_radius: px(-3.0),
1004 inset: false,
1005 color: hsla(0.0, 0.0, 0.0, 0.15),
1006 },
1007 shadow_xl: BoxShadow {
1008 offset: point(px(0.0), px(20.0)),
1009 blur_radius: px(25.0),
1010 spread_radius: px(-5.0),
1011 inset: false,
1012 color: hsla(0.0, 0.0, 0.0, 0.15),
1013 },
1014
1015 ring_offset: px(2.0),
1016
1017 transition_fast: Duration::from_millis(150),
1018 transition_base: Duration::from_millis(200),
1019 transition_slow: Duration::from_millis(300),
1020
1021 font_family: UI_FONT_FAMILY.into(),
1022 font_mono: UI_MONO_FONT_FAMILY.into(),
1023
1024 ..Default::default()
1025 }
1026 .apply_standard()
1027 }
1028
1029 pub fn catppuccin_mocha() -> Self {
1030 Self {
1031 background: rgb(0x181825).into(), foreground: rgb(0xcdd6f4).into(),
1033 card: rgb(0x1e1e2e).into(),
1034 card_foreground: rgb(0xcdd6f4).into(),
1035 popover: rgb(0x1e1e2e).into(),
1036 popover_foreground: rgb(0xcdd6f4).into(),
1037 muted: rgb(0x313244).into(),
1038 muted_foreground: rgb(0x7f849c).into(),
1039 accent: rgb(0x45475a).into(),
1040 accent_foreground: rgb(0x89b4fa).into(),
1041 primary: rgb(0x89b4fa).into(), primary_foreground: rgb(0x181825).into(),
1043 secondary: rgb(0x585b70).into(),
1044 secondary_foreground: rgb(0xcdd6f4).into(),
1045 destructive: rgb(0xf38ba8).into(),
1046 destructive_foreground: rgb(0xcdd6f4).into(),
1047 border: rgb(0x313244).into(),
1048 input: rgb(0x313244).into(),
1049 ring: rgb(0x89b4fa).into(),
1050
1051 radius_sm: px(4.0),
1052 radius_md: px(6.0),
1053 radius_lg: px(8.0),
1054 radius_xl: px(12.0),
1055
1056 shadow_xs: BoxShadow {
1057 offset: point(px(0.0), px(1.0)),
1058 blur_radius: px(2.0),
1059 spread_radius: px(0.0),
1060 inset: false,
1061 color: hsla(0.0, 0.0, 0.0, 0.15),
1062 },
1063 shadow_sm: BoxShadow {
1064 offset: point(px(0.0), px(1.0)),
1065 blur_radius: px(3.0),
1066 spread_radius: px(0.0),
1067 inset: false,
1068 color: hsla(0.0, 0.0, 0.0, 0.2),
1069 },
1070 shadow_md: BoxShadow {
1071 offset: point(px(0.0), px(4.0)),
1072 blur_radius: px(6.0),
1073 spread_radius: px(-1.0),
1074 inset: false,
1075 color: hsla(0.0, 0.0, 0.0, 0.15),
1076 },
1077 shadow_lg: BoxShadow {
1078 offset: point(px(0.0), px(10.0)),
1079 blur_radius: px(15.0),
1080 spread_radius: px(-3.0),
1081 inset: false,
1082 color: hsla(0.0, 0.0, 0.0, 0.15),
1083 },
1084 shadow_xl: BoxShadow {
1085 offset: point(px(0.0), px(20.0)),
1086 blur_radius: px(25.0),
1087 spread_radius: px(-5.0),
1088 inset: false,
1089 color: hsla(0.0, 0.0, 0.0, 0.15),
1090 },
1091
1092 ring_offset: px(2.0),
1093
1094 transition_fast: Duration::from_millis(150),
1095 transition_base: Duration::from_millis(200),
1096 transition_slow: Duration::from_millis(300),
1097
1098 font_family: UI_FONT_FAMILY.into(),
1099 font_mono: UI_MONO_FONT_FAMILY.into(),
1100
1101 ..Default::default()
1102 }
1103 .apply_standard()
1104 }
1105
1106 pub fn rose_pine() -> Self {
1107 Self {
1108 background: rgb(0x131019).into(), foreground: rgb(0xe0def4).into(),
1110 card: rgb(0x191724).into(),
1111 card_foreground: rgb(0xe0def4).into(),
1112 popover: rgb(0x191724).into(),
1113 popover_foreground: rgb(0xe0def4).into(),
1114 muted: rgb(0x1f1d2e).into(),
1115 muted_foreground: rgb(0x6e6a86).into(),
1116 accent: rgb(0x26233a).into(),
1117 accent_foreground: rgb(0xc4a7e7).into(),
1118 primary: rgb(0xc4a7e7).into(), primary_foreground: rgb(0x131019).into(),
1120 secondary: rgb(0x2a273f).into(),
1121 secondary_foreground: rgb(0xe0def4).into(),
1122 destructive: rgb(0xeb6f92).into(),
1123 destructive_foreground: rgb(0xe0def4).into(),
1124 border: rgb(0x26233a).into(),
1125 input: rgb(0x26233a).into(),
1126 ring: rgb(0xc4a7e7).into(),
1127
1128 radius_sm: px(4.0),
1129 radius_md: px(6.0),
1130 radius_lg: px(8.0),
1131 radius_xl: px(12.0),
1132
1133 shadow_xs: BoxShadow {
1134 offset: point(px(0.0), px(1.0)),
1135 blur_radius: px(2.0),
1136 spread_radius: px(0.0),
1137 inset: false,
1138 color: hsla(0.0, 0.0, 0.0, 0.15),
1139 },
1140 shadow_sm: BoxShadow {
1141 offset: point(px(0.0), px(1.0)),
1142 blur_radius: px(3.0),
1143 spread_radius: px(0.0),
1144 inset: false,
1145 color: hsla(0.0, 0.0, 0.0, 0.2),
1146 },
1147 shadow_md: BoxShadow {
1148 offset: point(px(0.0), px(4.0)),
1149 blur_radius: px(6.0),
1150 spread_radius: px(-1.0),
1151 inset: false,
1152 color: hsla(0.0, 0.0, 0.0, 0.15),
1153 },
1154 shadow_lg: BoxShadow {
1155 offset: point(px(0.0), px(10.0)),
1156 blur_radius: px(15.0),
1157 spread_radius: px(-3.0),
1158 inset: false,
1159 color: hsla(0.0, 0.0, 0.0, 0.15),
1160 },
1161 shadow_xl: BoxShadow {
1162 offset: point(px(0.0), px(20.0)),
1163 blur_radius: px(25.0),
1164 spread_radius: px(-5.0),
1165 inset: false,
1166 color: hsla(0.0, 0.0, 0.0, 0.15),
1167 },
1168
1169 ring_offset: px(2.0),
1170
1171 transition_fast: Duration::from_millis(150),
1172 transition_base: Duration::from_millis(200),
1173 transition_slow: Duration::from_millis(300),
1174
1175 font_family: UI_FONT_FAMILY.into(),
1176 font_mono: UI_MONO_FONT_FAMILY.into(),
1177
1178 ..Default::default()
1179 }
1180 .apply_standard()
1181 }
1182
1183 pub fn coral_reef() -> Self {
1184 Self {
1185 background: rgb(0xFFFBF8).into(), foreground: rgb(0x2D3748).into(), card: rgb(0xFFFFFF).into(), card_foreground: rgb(0x2D3748).into(),
1189 popover: rgb(0xFFFFFF).into(),
1190 popover_foreground: rgb(0x2D3748).into(),
1191 muted: rgb(0xFFF5F0).into(), muted_foreground: rgb(0x718096).into(), accent: rgb(0xFFE4D6).into(), accent_foreground: rgb(0x2D3748).into(),
1195 primary: rgb(0xFF6B6B).into(), primary_foreground: rgb(0xFFFFFF).into(),
1197 secondary: rgb(0x4FD1C5).into(), secondary_foreground: rgb(0xFFFFFF).into(),
1199 destructive: rgb(0xF56565).into(), destructive_foreground: rgb(0xFFFFFF).into(),
1201 border: rgb(0xFFD4C2).into(), input: rgb(0xFFE4D6).into(),
1203 ring: rgb(0xFF6B6B).into(), radius_sm: px(6.0),
1206 radius_md: px(8.0),
1207 radius_lg: px(12.0),
1208 radius_xl: px(12.0),
1209
1210 shadow_xs: BoxShadow {
1211 offset: point(px(0.0), px(1.0)),
1212 blur_radius: px(2.0),
1213 spread_radius: px(0.0),
1214 inset: false,
1215 color: hsla(0.0, 0.0, 0.0, 0.15),
1216 },
1217 shadow_sm: BoxShadow {
1218 offset: point(px(0.0), px(1.0)),
1219 blur_radius: px(3.0),
1220 spread_radius: px(0.0),
1221 inset: false,
1222 color: hsla(0.0, 0.0, 0.0, 0.2),
1223 },
1224 shadow_md: BoxShadow {
1225 offset: point(px(0.0), px(4.0)),
1226 blur_radius: px(6.0),
1227 spread_radius: px(-1.0),
1228 inset: false,
1229 color: hsla(0.0, 0.0, 0.0, 0.15),
1230 },
1231 shadow_lg: BoxShadow {
1232 offset: point(px(0.0), px(10.0)),
1233 blur_radius: px(15.0),
1234 spread_radius: px(-3.0),
1235 inset: false,
1236 color: hsla(0.0, 0.0, 0.0, 0.15),
1237 },
1238 shadow_xl: BoxShadow {
1239 offset: point(px(0.0), px(20.0)),
1240 blur_radius: px(25.0),
1241 spread_radius: px(-5.0),
1242 inset: false,
1243 color: hsla(0.0, 0.0, 0.0, 0.15),
1244 },
1245
1246 ring_offset: px(2.0),
1247
1248 transition_fast: Duration::from_millis(150),
1249 transition_base: Duration::from_millis(200),
1250 transition_slow: Duration::from_millis(300),
1251
1252 font_family: UI_FONT_FAMILY.into(),
1253 font_mono: UI_MONO_FONT_FAMILY.into(),
1254
1255 ..Default::default()
1256 }
1257 .apply_standard()
1258 }
1259
1260 pub fn lavender_dreams() -> Self {
1261 Self {
1262 background: rgb(0xF8F7FF).into(), foreground: rgb(0x2D2A3D).into(), card: rgb(0xFFFFFF).into(), card_foreground: rgb(0x2D2A3D).into(),
1266 popover: rgb(0xFFFFFF).into(),
1267 popover_foreground: rgb(0x2D2A3D).into(),
1268 muted: rgb(0xF0EDFF).into(), muted_foreground: rgb(0x6B6880).into(), accent: rgb(0xE8E3FF).into(), accent_foreground: rgb(0x2D2A3D).into(),
1272 primary: rgb(0x9F7AEA).into(), primary_foreground: rgb(0xFFFFFF).into(),
1274 secondary: rgb(0xB794F6).into(), secondary_foreground: rgb(0xFFFFFF).into(),
1276 destructive: rgb(0xE53E3E).into(), destructive_foreground: rgb(0xFFFFFF).into(),
1278 border: rgb(0xD6CEFF).into(), input: rgb(0xE8E3FF).into(),
1280 ring: rgb(0x9F7AEA).into(), radius_sm: px(6.0),
1283 radius_md: px(8.0),
1284 radius_lg: px(12.0),
1285 radius_xl: px(12.0),
1286
1287 shadow_xs: BoxShadow {
1288 offset: point(px(0.0), px(1.0)),
1289 blur_radius: px(2.0),
1290 spread_radius: px(0.0),
1291 inset: false,
1292 color: hsla(0.0, 0.0, 0.0, 0.15),
1293 },
1294 shadow_sm: BoxShadow {
1295 offset: point(px(0.0), px(1.0)),
1296 blur_radius: px(3.0),
1297 spread_radius: px(0.0),
1298 inset: false,
1299 color: hsla(0.0, 0.0, 0.0, 0.2),
1300 },
1301 shadow_md: BoxShadow {
1302 offset: point(px(0.0), px(4.0)),
1303 blur_radius: px(6.0),
1304 spread_radius: px(-1.0),
1305 inset: false,
1306 color: hsla(0.0, 0.0, 0.0, 0.15),
1307 },
1308 shadow_lg: BoxShadow {
1309 offset: point(px(0.0), px(10.0)),
1310 blur_radius: px(15.0),
1311 spread_radius: px(-3.0),
1312 inset: false,
1313 color: hsla(0.0, 0.0, 0.0, 0.15),
1314 },
1315 shadow_xl: BoxShadow {
1316 offset: point(px(0.0), px(20.0)),
1317 blur_radius: px(25.0),
1318 spread_radius: px(-5.0),
1319 inset: false,
1320 color: hsla(0.0, 0.0, 0.0, 0.15),
1321 },
1322
1323 ring_offset: px(2.0),
1324
1325 transition_fast: Duration::from_millis(150),
1326 transition_base: Duration::from_millis(200),
1327 transition_slow: Duration::from_millis(300),
1328
1329 font_family: UI_FONT_FAMILY.into(),
1330 font_mono: UI_MONO_FONT_FAMILY.into(),
1331
1332 ..Default::default()
1333 }
1334 .apply_standard()
1335 }
1336
1337 pub fn mint_fresh() -> Self {
1338 Self {
1339 background: rgb(0xF7FDFB).into(), foreground: rgb(0x1A4D3C).into(), card: rgb(0xFFFFFF).into(), card_foreground: rgb(0x1A4D3C).into(),
1343 popover: rgb(0xFFFFFF).into(),
1344 popover_foreground: rgb(0x1A4D3C).into(),
1345 muted: rgb(0xE6F9F3).into(), muted_foreground: rgb(0x4A7C69).into(), accent: rgb(0xD4F4E8).into(), accent_foreground: rgb(0x1A4D3C).into(),
1349 primary: rgb(0x38B2AC).into(), primary_foreground: rgb(0xFFFFFF).into(),
1351 secondary: rgb(0x48BB78).into(), secondary_foreground: rgb(0xFFFFFF).into(),
1353 destructive: rgb(0xF56565).into(), destructive_foreground: rgb(0xFFFFFF).into(),
1355 border: rgb(0xB8EBD9).into(), input: rgb(0xD4F4E8).into(),
1357 ring: rgb(0x38B2AC).into(), radius_sm: px(6.0),
1360 radius_md: px(8.0),
1361 radius_lg: px(12.0),
1362 radius_xl: px(12.0),
1363
1364 shadow_xs: BoxShadow {
1365 offset: point(px(0.0), px(1.0)),
1366 blur_radius: px(2.0),
1367 spread_radius: px(0.0),
1368 inset: false,
1369 color: hsla(0.0, 0.0, 0.0, 0.15),
1370 },
1371 shadow_sm: BoxShadow {
1372 offset: point(px(0.0), px(1.0)),
1373 blur_radius: px(3.0),
1374 spread_radius: px(0.0),
1375 inset: false,
1376 color: hsla(0.0, 0.0, 0.0, 0.2),
1377 },
1378 shadow_md: BoxShadow {
1379 offset: point(px(0.0), px(4.0)),
1380 blur_radius: px(6.0),
1381 spread_radius: px(-1.0),
1382 inset: false,
1383 color: hsla(0.0, 0.0, 0.0, 0.15),
1384 },
1385 shadow_lg: BoxShadow {
1386 offset: point(px(0.0), px(10.0)),
1387 blur_radius: px(15.0),
1388 spread_radius: px(-3.0),
1389 inset: false,
1390 color: hsla(0.0, 0.0, 0.0, 0.15),
1391 },
1392 shadow_xl: BoxShadow {
1393 offset: point(px(0.0), px(20.0)),
1394 blur_radius: px(25.0),
1395 spread_radius: px(-5.0),
1396 inset: false,
1397 color: hsla(0.0, 0.0, 0.0, 0.15),
1398 },
1399
1400 ring_offset: px(2.0),
1401
1402 transition_fast: Duration::from_millis(150),
1403 transition_base: Duration::from_millis(200),
1404 transition_slow: Duration::from_millis(300),
1405
1406 font_family: UI_FONT_FAMILY.into(),
1407 font_mono: UI_MONO_FONT_FAMILY.into(),
1408
1409 ..Default::default()
1410 }
1411 .apply_standard()
1412 }
1413
1414 pub fn peachy_keen() -> Self {
1415 Self {
1416 background: rgb(0xFFFAF5).into(), foreground: rgb(0x3D2817).into(), card: rgb(0xFFFFFF).into(), card_foreground: rgb(0x3D2817).into(),
1420 popover: rgb(0xFFFFFF).into(),
1421 popover_foreground: rgb(0x3D2817).into(),
1422 muted: rgb(0xFFF0E0).into(), muted_foreground: rgb(0x8B6B47).into(), accent: rgb(0xFFE4CC).into(), accent_foreground: rgb(0x3D2817).into(),
1426 primary: rgb(0xFF9966).into(), primary_foreground: rgb(0xFFFFFF).into(),
1428 secondary: rgb(0xFFB84D).into(), secondary_foreground: rgb(0xFFFFFF).into(),
1430 destructive: rgb(0xE53E3E).into(), destructive_foreground: rgb(0xFFFFFF).into(),
1432 border: rgb(0xFFD9B3).into(), input: rgb(0xFFE4CC).into(),
1434 ring: rgb(0xFF9966).into(), radius_sm: px(6.0),
1437 radius_md: px(8.0),
1438 radius_lg: px(12.0),
1439 radius_xl: px(12.0),
1440
1441 shadow_xs: BoxShadow {
1442 offset: point(px(0.0), px(1.0)),
1443 blur_radius: px(2.0),
1444 spread_radius: px(0.0),
1445 inset: false,
1446 color: hsla(0.0, 0.0, 0.0, 0.15),
1447 },
1448 shadow_sm: BoxShadow {
1449 offset: point(px(0.0), px(1.0)),
1450 blur_radius: px(3.0),
1451 spread_radius: px(0.0),
1452 inset: false,
1453 color: hsla(0.0, 0.0, 0.0, 0.2),
1454 },
1455 shadow_md: BoxShadow {
1456 offset: point(px(0.0), px(4.0)),
1457 blur_radius: px(6.0),
1458 spread_radius: px(-1.0),
1459 inset: false,
1460 color: hsla(0.0, 0.0, 0.0, 0.15),
1461 },
1462 shadow_lg: BoxShadow {
1463 offset: point(px(0.0), px(10.0)),
1464 blur_radius: px(15.0),
1465 spread_radius: px(-3.0),
1466 inset: false,
1467 color: hsla(0.0, 0.0, 0.0, 0.15),
1468 },
1469 shadow_xl: BoxShadow {
1470 offset: point(px(0.0), px(20.0)),
1471 blur_radius: px(25.0),
1472 spread_radius: px(-5.0),
1473 inset: false,
1474 color: hsla(0.0, 0.0, 0.0, 0.15),
1475 },
1476
1477 ring_offset: px(2.0),
1478
1479 transition_fast: Duration::from_millis(150),
1480 transition_base: Duration::from_millis(200),
1481 transition_slow: Duration::from_millis(300),
1482
1483 font_family: UI_FONT_FAMILY.into(),
1484 font_mono: UI_MONO_FONT_FAMILY.into(),
1485
1486 ..Default::default()
1487 }
1488 .apply_standard()
1489 }
1490
1491 pub fn sky_blue() -> Self {
1492 Self {
1493 background: rgb(0xF7FAFD).into(), foreground: rgb(0x1E3A5F).into(), card: rgb(0xFFFFFF).into(), card_foreground: rgb(0x1E3A5F).into(),
1497 popover: rgb(0xFFFFFF).into(),
1498 popover_foreground: rgb(0x1E3A5F).into(),
1499 muted: rgb(0xE3F2FD).into(), muted_foreground: rgb(0x5B7C99).into(), accent: rgb(0xBBDEFB).into(), accent_foreground: rgb(0x1E3A5F).into(),
1503 primary: rgb(0x2196F3).into(), primary_foreground: rgb(0xFFFFFF).into(),
1505 secondary: rgb(0x42A5F5).into(), secondary_foreground: rgb(0xFFFFFF).into(),
1507 destructive: rgb(0xF44336).into(), destructive_foreground: rgb(0xFFFFFF).into(),
1509 border: rgb(0x90CAF9).into(), input: rgb(0xBBDEFB).into(),
1511 ring: rgb(0x2196F3).into(), radius_sm: px(6.0),
1514 radius_md: px(8.0),
1515 radius_lg: px(12.0),
1516 radius_xl: px(12.0),
1517
1518 shadow_xs: BoxShadow {
1519 offset: point(px(0.0), px(1.0)),
1520 blur_radius: px(2.0),
1521 spread_radius: px(0.0),
1522 inset: false,
1523 color: hsla(0.0, 0.0, 0.0, 0.15),
1524 },
1525 shadow_sm: BoxShadow {
1526 offset: point(px(0.0), px(1.0)),
1527 blur_radius: px(3.0),
1528 spread_radius: px(0.0),
1529 inset: false,
1530 color: hsla(0.0, 0.0, 0.0, 0.2),
1531 },
1532 shadow_md: BoxShadow {
1533 offset: point(px(0.0), px(4.0)),
1534 blur_radius: px(6.0),
1535 spread_radius: px(-1.0),
1536 inset: false,
1537 color: hsla(0.0, 0.0, 0.0, 0.15),
1538 },
1539 shadow_lg: BoxShadow {
1540 offset: point(px(0.0), px(10.0)),
1541 blur_radius: px(15.0),
1542 spread_radius: px(-3.0),
1543 inset: false,
1544 color: hsla(0.0, 0.0, 0.0, 0.15),
1545 },
1546 shadow_xl: BoxShadow {
1547 offset: point(px(0.0), px(20.0)),
1548 blur_radius: px(25.0),
1549 spread_radius: px(-5.0),
1550 inset: false,
1551 color: hsla(0.0, 0.0, 0.0, 0.15),
1552 },
1553
1554 ring_offset: px(2.0),
1555
1556 transition_fast: Duration::from_millis(150),
1557 transition_base: Duration::from_millis(200),
1558 transition_slow: Duration::from_millis(300),
1559
1560 font_family: UI_FONT_FAMILY.into(),
1561 font_mono: UI_MONO_FONT_FAMILY.into(),
1562
1563 ..Default::default()
1564 }
1565 .apply_standard()
1566 }
1567
1568 pub fn cherry_blossom() -> Self {
1569 Self {
1570 background: rgb(0xFFF8FB).into(), foreground: rgb(0x4A1942).into(), card: rgb(0xFFFFFF).into(), card_foreground: rgb(0x4A1942).into(),
1574 popover: rgb(0xFFFFFF).into(),
1575 popover_foreground: rgb(0x4A1942).into(),
1576 muted: rgb(0xFFE8F5).into(), muted_foreground: rgb(0x9B4F96).into(), accent: rgb(0xFFD6ED).into(), accent_foreground: rgb(0x4A1942).into(),
1580 primary: rgb(0xE91E63).into(), primary_foreground: rgb(0xFFFFFF).into(),
1582 secondary: rgb(0xF06292).into(), secondary_foreground: rgb(0xFFFFFF).into(),
1584 destructive: rgb(0xE53935).into(), destructive_foreground: rgb(0xFFFFFF).into(),
1586 border: rgb(0xFFB3D9).into(), input: rgb(0xFFD6ED).into(),
1588 ring: rgb(0xE91E63).into(), radius_sm: px(6.0),
1591 radius_md: px(8.0),
1592 radius_lg: px(12.0),
1593 radius_xl: px(12.0),
1594
1595 shadow_xs: BoxShadow {
1596 offset: point(px(0.0), px(1.0)),
1597 blur_radius: px(2.0),
1598 spread_radius: px(0.0),
1599 inset: false,
1600 color: hsla(0.0, 0.0, 0.0, 0.15),
1601 },
1602 shadow_sm: BoxShadow {
1603 offset: point(px(0.0), px(1.0)),
1604 blur_radius: px(3.0),
1605 spread_radius: px(0.0),
1606 inset: false,
1607 color: hsla(0.0, 0.0, 0.0, 0.2),
1608 },
1609 shadow_md: BoxShadow {
1610 offset: point(px(0.0), px(4.0)),
1611 blur_radius: px(6.0),
1612 spread_radius: px(-1.0),
1613 inset: false,
1614 color: hsla(0.0, 0.0, 0.0, 0.15),
1615 },
1616 shadow_lg: BoxShadow {
1617 offset: point(px(0.0), px(10.0)),
1618 blur_radius: px(15.0),
1619 spread_radius: px(-3.0),
1620 inset: false,
1621 color: hsla(0.0, 0.0, 0.0, 0.15),
1622 },
1623 shadow_xl: BoxShadow {
1624 offset: point(px(0.0), px(20.0)),
1625 blur_radius: px(25.0),
1626 spread_radius: px(-5.0),
1627 inset: false,
1628 color: hsla(0.0, 0.0, 0.0, 0.15),
1629 },
1630
1631 ring_offset: px(2.0),
1632
1633 transition_fast: Duration::from_millis(150),
1634 transition_base: Duration::from_millis(200),
1635 transition_slow: Duration::from_millis(300),
1636
1637 font_family: UI_FONT_FAMILY.into(),
1638 font_mono: UI_MONO_FONT_FAMILY.into(),
1639
1640 ..Default::default()
1641 }
1642 .apply_standard()
1643 }
1644}
1645
1646impl ThemeTokens {
1647 pub fn gradient_primary(&self) -> gpui::Background {
1648 let c = self.primary;
1649 let darkened = hsla(c.h, c.s, (c.l - 0.08).max(0.0), c.a);
1650 gpui::linear_gradient(
1651 180.0,
1652 gpui::linear_color_stop(c, 0.0),
1653 gpui::linear_color_stop(darkened, 1.0),
1654 )
1655 }
1656
1657 pub fn gradient_surface(&self) -> gpui::Background {
1658 let c = self.card;
1659 let lightened = hsla(c.h, c.s, (c.l + 0.02).min(1.0), c.a);
1660 gpui::linear_gradient(
1661 135.0,
1662 gpui::linear_color_stop(c, 0.0),
1663 gpui::linear_color_stop(lightened, 1.0),
1664 )
1665 }
1666
1667 pub fn gradient_accent(&self) -> gpui::Background {
1668 let c = self.accent;
1669 let darkened = hsla(c.h, c.s, (c.l - 0.06).max(0.0), c.a);
1670 gpui::linear_gradient(
1671 180.0,
1672 gpui::linear_color_stop(c, 0.0),
1673 gpui::linear_color_stop(darkened, 1.0),
1674 )
1675 }
1676
1677 pub fn gradient_destructive(&self) -> gpui::Background {
1678 let c = self.destructive;
1679 let darkened = hsla(c.h, c.s, (c.l - 0.08).max(0.0), c.a);
1680 gpui::linear_gradient(
1681 180.0,
1682 gpui::linear_color_stop(c, 0.0),
1683 gpui::linear_color_stop(darkened, 1.0),
1684 )
1685 }
1686
1687 pub fn glow_shadow(&self, color: Hsla, intensity: f32) -> BoxShadow {
1688 BoxShadow {
1689 color: color.opacity(0.4 * intensity),
1690 offset: point(px(0.0), px(0.0)),
1691 blur_radius: px(20.0 * intensity),
1692 spread_radius: px(2.0),
1693 inset: false,
1694 }
1695 }
1696
1697 pub fn colored_shadow(&self, color: Hsla, size: f32) -> BoxShadow {
1698 BoxShadow {
1699 color: color.opacity(0.25),
1700 offset: point(px(0.0), px(2.0 * size)),
1701 blur_radius: px(8.0 * size),
1702 spread_radius: px(0.0),
1703 inset: false,
1704 }
1705 }
1706
1707 pub fn focus_ring_animated(&self, progress: f32) -> BoxShadow {
1708 BoxShadow {
1709 offset: point(px(0.0), px(0.0)),
1710 blur_radius: px(0.0),
1711 spread_radius: px(3.0 * progress),
1712 inset: false,
1713 color: self.ring.opacity(0.5 * progress),
1714 }
1715 }
1716
1717 pub fn focus_ring(&self, opacity: f32) -> BoxShadow {
1719 BoxShadow {
1720 offset: point(px(0.0), px(0.0)),
1721 blur_radius: px(0.0),
1722 spread_radius: px(3.0),
1723 inset: false,
1724 color: self.ring.opacity(opacity),
1725 }
1726 }
1727
1728 pub fn focus_ring_light(&self) -> BoxShadow {
1730 self.focus_ring(0.5)
1731 }
1732
1733 pub fn focus_ring_dark(&self) -> BoxShadow {
1735 self.focus_ring(0.4)
1736 }
1737
1738 pub fn error_ring(&self) -> BoxShadow {
1740 BoxShadow {
1741 offset: point(px(0.0), px(0.0)),
1742 blur_radius: px(0.0),
1743 spread_radius: px(3.0),
1744 inset: false,
1745 color: self.destructive.opacity(0.2),
1746 }
1747 }
1748
1749 pub fn success_ring(&self) -> BoxShadow {
1751 let success_color = hsla(0.33, 0.70, 0.50, 1.0);
1752 BoxShadow {
1753 offset: point(px(0.0), px(0.0)),
1754 blur_radius: px(0.0),
1755 spread_radius: px(3.0),
1756 inset: false,
1757 color: success_color.opacity(0.2),
1758 }
1759 }
1760
1761 pub fn inset_shadow_top(&self, intensity: f32) -> BoxShadow {
1762 BoxShadow {
1763 offset: point(px(0.0), px(2.0)),
1764 blur_radius: px(4.0),
1765 spread_radius: px(-1.0),
1766 inset: true,
1767 color: hsla(0.0, 0.0, 0.0, 0.08 * intensity),
1768 }
1769 }
1770
1771 pub fn inset_shadow_bottom(&self, intensity: f32) -> BoxShadow {
1772 BoxShadow {
1773 offset: point(px(0.0), px(-2.0)),
1774 blur_radius: px(4.0),
1775 spread_radius: px(-1.0),
1776 inset: true,
1777 color: hsla(0.0, 0.0, 0.0, 0.08 * intensity),
1778 }
1779 }
1780
1781 pub fn inset_shadow_both(&self, intensity: f32) -> Vec<BoxShadow> {
1782 vec![
1783 self.inset_shadow_top(intensity),
1784 self.inset_shadow_bottom(intensity),
1785 ]
1786 }
1787
1788 pub fn elevation_shadow(&self, level: u8) -> Vec<BoxShadow> {
1789 match level {
1790 0 => vec![],
1791 1 => vec![self.shadow_xs.clone()],
1792 2 => vec![self.shadow_sm.clone()],
1793 3 => vec![self.shadow_md.clone()],
1794 4 => vec![self.shadow_lg.clone()],
1795 _ => vec![self.shadow_xl.clone()],
1796 }
1797 }
1798
1799 pub fn layered_gradient(&self, angle: f32, colors: &[Hsla]) -> Vec<gpui::Background> {
1800 if colors.len() < 2 {
1801 return vec![];
1802 }
1803
1804 let mut layers = Vec::new();
1805 for window in colors.windows(2) {
1806 layers.push(gpui::linear_gradient(
1807 angle,
1808 gpui::linear_color_stop(window[0], 0.0),
1809 gpui::linear_color_stop(window[1], 1.0),
1810 ));
1811 }
1812 layers
1813 }
1814}
1815
1816#[cfg(test)]
1817mod tests {
1818 use super::ThemeTokens;
1821 use gpui::px;
1822 use std::time::Duration;
1823
1824 #[test]
1825 fn standard_tokens_match_shared_scale() {
1826 let themes = [
1827 ThemeTokens::light(),
1828 ThemeTokens::dark(),
1829 ThemeTokens::midnight_blue(),
1830 ThemeTokens::forest_grove(),
1831 ThemeTokens::sunset_amber(),
1832 ThemeTokens::ocean_breeze(),
1833 ThemeTokens::dracula(),
1834 ThemeTokens::nord(),
1835 ThemeTokens::monokai_pro(),
1836 ThemeTokens::tokyo_night(),
1837 ThemeTokens::catppuccin_mocha(),
1838 ThemeTokens::rose_pine(),
1839 ThemeTokens::coral_reef(),
1840 ThemeTokens::lavender_dreams(),
1841 ThemeTokens::mint_fresh(),
1842 ThemeTokens::peachy_keen(),
1843 ThemeTokens::sky_blue(),
1844 ThemeTokens::cherry_blossom(),
1845 ];
1846
1847 for tokens in themes {
1848 assert_eq!(tokens.spacing_1, px(4.0));
1852 assert_eq!(tokens.spacing_4, px(16.0));
1853 assert_eq!(tokens.spacing_16, px(64.0));
1854 assert_eq!(tokens.duration_fastest, Duration::from_millis(50));
1855 assert_eq!(tokens.duration_normal, Duration::from_millis(200));
1856 assert_eq!(tokens.duration_slowest, Duration::from_millis(500));
1857 assert_eq!(tokens.z_dropdown, 1000);
1858 assert_eq!(tokens.z_sticky, 900);
1859 assert_eq!(tokens.z_modal, 1300);
1860 assert_eq!(tokens.z_popover, 1400);
1861 assert_eq!(tokens.z_tooltip, 1500);
1862
1863 assert_eq!(tokens.text_xs, px(12.0));
1864 assert_eq!(tokens.text_sm, px(14.0));
1865 assert_eq!(tokens.text_base, px(16.0));
1866 assert_eq!(tokens.text_lg, px(18.0));
1867 assert_eq!(tokens.text_xl, px(20.0));
1868 assert_eq!(tokens.text_2xl, px(24.0));
1869 assert_eq!(tokens.text_3xl, px(30.0));
1870 assert_eq!(tokens.text_4xl, px(36.0));
1871 assert_eq!(tokens.text_5xl, px(48.0));
1872
1873 assert_eq!(tokens.leading_none, 1.0);
1874 assert_eq!(tokens.leading_tight, 1.25);
1875 assert_eq!(tokens.leading_snug, 1.375);
1876 assert_eq!(tokens.leading_normal, 1.5);
1877 assert_eq!(tokens.leading_relaxed, 1.625);
1878 assert_eq!(tokens.leading_loose, 2.0);
1879 }
1880 }
1881}