Skip to content

Commit 5943e77

Browse files
threepointoneKumo Bot
andauthored
Add missing success background and tint color tokens (#43)
* fix Add success semantic color tokens Add missing `success` semantic tokens and mappings for parity with info/warning/danger. Includes: a changeset, new CSS variables (`--color-kumo-success`, `--color-kumo-success-tint`), update to `--text-color-kumo-success` dark value (use green-400 for better contrast), theme-generator config entries for kumo-success and kumo-success-tint, Figma generator/ parser mappings, and update Meter demo to use the `kumo-success` utility classes. * feat(badge): add success variant Add new 'success' Badge variant for positive state indicators, using the bg-kumo-success semantic color token. --------- Co-authored-by: Kumo Bot <kumo-bot@cloudflare.com>
1 parent 8972cc4 commit 5943e77

File tree

8 files changed

+52
-4
lines changed

8 files changed

+52
-4
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudflare/kumo": patch
3+
---
4+
5+
Add missing `success` background and tint semantic color tokens (`bg-kumo-success`, `bg-kumo-success-tint`) for parity with `info`, `warning`, and `danger`. Fix `text-kumo-success` dark mode contrast by using `green-400` instead of `green-500`. Add new `success` Badge variant for positive state indicators.

packages/kumo-docs-astro/src/components/demos/BadgeDemo.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export function BadgeVariantsDemo() {
66
<Badge variant="primary">Primary</Badge>
77
<Badge variant="secondary">Secondary</Badge>
88
<Badge variant="destructive">Destructive</Badge>
9+
<Badge variant="success">Success</Badge>
910
<Badge variant="outline">Outline</Badge>
1011
<Badge variant="beta">Beta</Badge>
1112
</div>
@@ -24,6 +25,10 @@ export function BadgeDestructiveDemo() {
2425
return <Badge variant="destructive">Destructive</Badge>;
2526
}
2627

28+
export function BadgeSuccessDemo() {
29+
return <Badge variant="success">Success</Badge>;
30+
}
31+
2732
export function BadgeOutlineDemo() {
2833
return <Badge variant="outline">Outline</Badge>;
2934
}

packages/kumo-docs-astro/src/components/demos/MeterDemo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function MeterCustomStyleDemo() {
2525
<Meter
2626
label="Upload progress"
2727
value={80}
28-
indicatorClassName="from-green-500 via-green-500 to-green-500"
28+
indicatorClassName="from-kumo-success via-kumo-success to-kumo-success"
2929
/>
3030
);
3131
}

packages/kumo-figma/src/generators/shared.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ export const VAR_NAMES = {
6363
warningTint: "color-kumo-warning-tint",
6464
danger: "color-kumo-danger",
6565
dangerTint: "color-kumo-danger-tint",
66+
success: "color-kumo-success",
67+
successTint: "color-kumo-success-tint",
6668
// Legacy aliases (for gradual migration from old naming convention)
6769
// Old: "color-{name}" → New: "color-kumo-{name}"
6870
surface: "color-kumo-base",

packages/kumo-figma/src/parsers/tailwind-to-figma.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ const COLOR_TO_VARIABLE: Record<string, string> = {
9797
"bg-kumo-warning-tint": "color-kumo-warning-tint",
9898
"bg-kumo-danger": "color-kumo-danger",
9999
"bg-kumo-danger-tint": "color-kumo-danger-tint",
100+
"bg-kumo-success": "color-kumo-success",
101+
"bg-kumo-success-tint": "color-kumo-success-tint",
100102
"bg-transparent": null!, // No fill
101103
"bg-inherit": null!, // No fill
102104

@@ -124,6 +126,7 @@ const COLOR_TO_VARIABLE: Record<string, string> = {
124126
"border-kumo-info": "color-kumo-info",
125127
"border-kumo-warning": "color-kumo-warning",
126128
"border-kumo-danger": "color-kumo-danger",
129+
"border-kumo-success": "color-kumo-success",
127130
"ring-kumo-line": "color-kumo-line",
128131
"ring-kumo-ring": "color-kumo-ring",
129132
"ring-kumo-danger": "color-kumo-danger",

packages/kumo/scripts/theme-generator/config.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export const THEME_CONFIG: ThemeConfig = {
8989
theme: {
9090
kumo: {
9191
light: "var(--color-green-500, oklch(72.3% 0.219 149.579))",
92-
dark: "var(--color-green-500, oklch(72.3% 0.219 149.579))",
92+
dark: "var(--color-green-400, oklch(79.2% 0.209 151.711))",
9393
},
9494
},
9595
},
@@ -325,6 +325,24 @@ export const THEME_CONFIG: ThemeConfig = {
325325
},
326326
},
327327
},
328+
"kumo-success": {
329+
newName: "",
330+
theme: {
331+
kumo: {
332+
light: "var(--color-green-500, oklch(72.3% 0.219 149.579))",
333+
dark: "var(--color-green-700, oklch(52.7% 0.154 150.069))",
334+
},
335+
},
336+
},
337+
"kumo-success-tint": {
338+
newName: "",
339+
theme: {
340+
kumo: {
341+
light: "var(--color-green-300, oklch(87.1% 0.15 154.449))",
342+
dark: "var(--color-green-900, oklch(39.3% 0.095 152.535))",
343+
},
344+
},
345+
},
328346
},
329347

330348
/**

packages/kumo/src/components/badge/badge.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,17 @@ export const KUMO_BADGE_VARIANTS = {
2020
classes: "bg-kumo-danger text-white",
2121
description: "Error or danger state indicator",
2222
},
23+
success: {
24+
classes: "bg-kumo-success text-white",
25+
description: "Success or positive state indicator",
26+
},
2327
outline: {
2428
classes: "border border-kumo-fill bg-transparent text-kumo-default",
2529
description: "Bordered badge with transparent background",
2630
},
2731
beta: {
28-
classes: "border border-dashed border-kumo-brand bg-transparent text-kumo-link",
32+
classes:
33+
"border border-dashed border-kumo-brand bg-transparent text-kumo-link",
2934
description: "Indicates beta or experimental features",
3035
},
3136
},

packages/kumo/src/styles/theme-kumo.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
--text-color-kumo-success: light-dark(
4747
var(--color-green-500, oklch(72.3% 0.219 149.579)),
48-
var(--color-green-500, oklch(72.3% 0.219 149.579))
48+
var(--color-green-400, oklch(79.2% 0.209 151.711))
4949
);
5050

5151
--text-color-kumo-danger: light-dark(
@@ -171,6 +171,16 @@
171171
var(--color-red-900, oklch(39.6% 0.141 25.723))
172172
);
173173

174+
--color-kumo-success: light-dark(
175+
var(--color-green-500, oklch(72.3% 0.219 149.579)),
176+
var(--color-green-700, oklch(52.7% 0.154 150.069))
177+
);
178+
179+
--color-kumo-success-tint: light-dark(
180+
var(--color-green-300, oklch(87.1% 0.15 154.449)),
181+
var(--color-green-900, oklch(39.3% 0.095 152.535))
182+
);
183+
174184
}
175185

176186
@theme {

0 commit comments

Comments
 (0)