@@ -14,6 +14,17 @@ search:
1414 - --co-theme-radius
1515---
1616
17+ export function ColorSwatch({ value , label = value }) {
18+ return (
19+ <span
20+ aria-label = { label }
21+ className = " inline-block size-4 border border-dashed border-border align-middle"
22+ style = { { background: value }}
23+ title = { label }
24+ />
25+ );
26+ }
27+
1728You can make the widget feel like part of your product without replacing any components.
1829
1930## Use this when
@@ -33,7 +44,7 @@ Set the widget tokens once and keep the default UI.
3344 --co-theme-background : #ffffff ;
3445 --co-theme-foreground : #111827 ;
3546 --co-theme-border : #e5e7eb ;
36- --co-theme-radius : 18 px ;
47+ --co-theme-radius : 0 px ;
3748}
3849```
3950
@@ -79,23 +90,46 @@ This keeps the widget aligned with the rest of your app instead of inventing a s
7990
8091## Core token reference
8192
82- | Variable | Default (Light) | Default (Dark) |
83- | ------------------------------- | ------------------ | ------------------ |
84- | ` --co-theme-background ` | ` oklch(99% 0 0) ` | ` oklch(15.5% 0 0) ` |
85- | ` --co-theme-foreground ` | ` oklch(14 .5% 0 0) ` | ` oklch(98 .5% 0 0) ` |
86- | ` --co-theme-primary ` | ` oklch(20 .5% 0 0) ` | ` oklch(98.5% 0 0) ` |
87- | ` --co-theme-primary-foreground ` | ` oklch(98.5% 0 0) ` | ` oklch(20 .5% 0 0) ` |
88- | ` --co-theme-border ` | ` oklch(92.2% 0 0) ` | ` oklch(26.9% 0 0) ` |
89- | ` --co-theme-muted ` | Color-mixed | Color-mixed |
90- | ` --co-theme-muted-foreground ` | Color-mixed | Color-mixed |
91- | ` --co-theme-radius ` | ` 0.375rem ` | ` 0.375rem ` |
93+ | Variable | Light preview | Default (Light) | Dark preview | Default (Dark) |
94+ | ------------------------------- | --------------------------------------------------------- | ------------------ | --------------------------------------------------------- | ------------------ |
95+ | ` --co-theme-background ` | < ColorSwatch value = " oklch(99% 0 0) " /> | ` oklch(99% 0 0) ` | < ColorSwatch value = " oklch(15.5% 0 0) " /> | ` oklch(15.5% 0 0) ` |
96+ | ` --co-theme-foreground ` | < ColorSwatch value = " oklch(20 .5% 0 0)" /> | ` oklch(20 .5% 0 0) ` | < ColorSwatch value = " oklch(95% 0 0) " /> | ` oklch(95% 0 0) ` |
97+ | ` --co-theme-primary ` | < ColorSwatch value = " oklch(14.5% 0 0) " /> | ` oklch(14 .5% 0 0) ` | < ColorSwatch value = " oklch(98.5% 0 0) " /> | ` oklch(98.5% 0 0) ` |
98+ | ` --co-theme-primary-foreground ` | < ColorSwatch value = " oklch(98.5% 0 0) " /> | ` oklch(98.5% 0 0) ` | < ColorSwatch value = " oklch(14.5% 0 0) " /> | ` oklch(14 .5% 0 0) ` |
99+ | ` --co-theme-border ` | < ColorSwatch value = " oklch(92.2% 0 0) " /> | ` oklch(92.2% 0 0) ` | < ColorSwatch value = " oklch(26.9% 0 0) " /> | ` oklch(26.9% 0 0) ` |
100+ | ` --co-theme-muted ` | < ColorSwatch value = " color-mix(in oklch, oklch(99% 0 0) 85%, oklch(20.5% 0 0)) " /> | Color-mixed | < ColorSwatch value = " color-mix(in oklch, oklch(15.5% 0 0) 55%, oklch(95% 0 0)) " /> | Color-mixed |
101+ | ` --co-theme-muted-foreground ` | < ColorSwatch value = " color-mix(in oklch, oklch(20.5% 0 0) 70%, white) " /> | Color-mixed | < ColorSwatch value = " color-mix(in oklch, oklch(95% 0 0) 65%, white) " /> | Color-mixed |
102+ | ` --co-theme-radius ` | - | ` 0.375rem ` | - | ` 0.375rem ` |
92103
93104## Extra tokens
94105
95106Use these when the core tokens are not enough:
96107
97- - Status colors: ` --co-theme-destructive ` , ` --co-theme-success ` , ` --co-theme-warning ` , ` --co-theme-neutral `
98- - Avatar accents: ` --co-theme-pink ` , ` --co-theme-yellow ` , ` --co-theme-blue ` , ` --co-theme-orange `
99- - Background shades: ` --co-theme-background-50 ` , ` --co-theme-background-100 ` , ` --co-theme-background-200 ` , ` --co-theme-background-300 `
108+ ### Status colors
109+
110+ | Variable | Light preview | Default (Light) | Dark preview | Default (Dark) |
111+ | ------------------------ | ------------------------------------------ | ------------------------ | ------------------------------------------ | ------------------------- |
112+ | ` --co-theme-destructive ` | <ColorSwatch value = " oklch(57.7% 0.245 27.325)" /> | ` oklch(57.7% 0.245 27.325) ` | <ColorSwatch value = " oklch(39.6% 0.141 25.723)" /> | ` oklch(39.6% 0.141 25.723) ` |
113+ | ` --co-theme-success ` | <ColorSwatch value = " oklch(71.7% 0.18 142)" /> | ` oklch(71.7% 0.18 142) ` | <ColorSwatch value = " oklch(60% 0.15 142)" /> | ` oklch(60% 0.15 142) ` |
114+ | ` --co-theme-warning ` | <ColorSwatch value = " oklch(86.4% 0.144 99)" /> | ` oklch(86.4% 0.144 99) ` | <ColorSwatch value = " oklch(90.3% 0.111 99)" /> | ` oklch(90.3% 0.111 99) ` |
115+ | ` --co-theme-neutral ` | <ColorSwatch value = " oklch(60.8% 0 0)" /> | ` oklch(60.8% 0 0) ` | <ColorSwatch value = " oklch(50% 0 0)" /> | ` oklch(50% 0 0) ` |
116+
117+ ### Avatar accents
118+
119+ | Variable | Light preview | Default (Light) | Dark preview | Default (Dark) |
120+ | ------------------- | ----------------------------------------- | ---------------------- | ----------------------------------------- | ---------------------- |
121+ | ` --co-theme-pink ` | <ColorSwatch value = " oklch(76.3% 0.152 354)" /> | ` oklch(76.3% 0.152 354) ` | <ColorSwatch value = " oklch(84.2% 0.109 354)" /> | ` oklch(84.2% 0.109 354) ` |
122+ | ` --co-theme-yellow ` | <ColorSwatch value = " oklch(86.4% 0.144 99)" /> | ` oklch(86.4% 0.144 99) ` | <ColorSwatch value = " oklch(90.3% 0.111 99)" /> | ` oklch(90.3% 0.111 99) ` |
123+ | ` --co-theme-blue ` | <ColorSwatch value = " oklch(72.5% 0.132 241)" /> | ` oklch(72.5% 0.132 241) ` | <ColorSwatch value = " oklch(79.8% 0.089 241)" /> | ` oklch(79.8% 0.089 241) ` |
124+ | ` --co-theme-orange ` | <ColorSwatch value = " oklch(74.5% 0.166 50)" /> | ` oklch(74.5% 0.166 50) ` | <ColorSwatch value = " oklch(68.2% 0.194 50)" /> | ` oklch(68.2% 0.194 50) ` |
125+
126+ ### Background shades
127+
128+ | Variable | Light preview | Default (Light) | Dark preview | Default (Dark) |
129+ | --------------------------- | ------------- | --------------- | ------------ | -------------- |
130+ | ` --co-theme-background-50 ` | <ColorSwatch value = " color-mix(in oklch, oklch(99% 0 0) 98%, oklch(20.5% 0 0))" /> | Color-mixed | <ColorSwatch value = " color-mix(in oklch, oklch(15.5% 0 0) 98%, oklch(95% 0 0))" /> | Color-mixed |
131+ | ` --co-theme-background-100 ` | <ColorSwatch value = " color-mix(in oklch, oklch(99% 0 0) 97%, oklch(20.5% 0 0))" /> | Color-mixed | <ColorSwatch value = " color-mix(in oklch, oklch(15.5% 0 0) 96%, oklch(95% 0 0))" /> | Color-mixed |
132+ | ` --co-theme-background-200 ` | <ColorSwatch value = " color-mix(in oklch, oklch(99% 0 0) 96%, oklch(20.5% 0 0))" /> | Color-mixed | <ColorSwatch value = " color-mix(in oklch, oklch(15.5% 0 0) 94%, oklch(95% 0 0))" /> | Color-mixed |
133+ | ` --co-theme-background-300 ` | <ColorSwatch value = " color-mix(in oklch, oklch(99% 0 0) 95%, oklch(20.5% 0 0))" /> | Color-mixed | <ColorSwatch value = " color-mix(in oklch, oklch(15.5% 0 0) 92%, oklch(95% 0 0))" /> | Color-mixed |
100134
101135The background shades are derived from your base colors with ` color-mix() ` unless you override them directly.
0 commit comments