Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Theme: Add new caution color ramp
Co-Authored-By: James Koster <846565+jameskoster@users.noreply.github.com>
  • Loading branch information
aduth and jameskoster committed Oct 31, 2025
commit 72d2b264de89c243b488dc1b0d628376961137f4
34 changes: 34 additions & 0 deletions packages/theme/docs/ds-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Do not edit directly.
| `--wpds-color-bg-surface-info-weak` | Background color for surfaces with info tone and weak emphasis. |
| `--wpds-color-bg-surface-warning` | Background color for surfaces with warning tone and normal emphasis. |
| `--wpds-color-bg-surface-warning-weak` | Background color for surfaces with warning tone and weak emphasis. |
| `--wpds-color-bg-surface-caution` | Background color for surfaces with caution tone and normal emphasis. |
| `--wpds-color-bg-surface-caution-weak` | Background color for surfaces with caution tone and weak emphasis. |
| `--wpds-color-bg-surface-error` | Background color for surfaces with error tone and normal emphasis. |
| `--wpds-color-bg-surface-error-weak` | Background color for surfaces with error tone and weak emphasis. |
| `--wpds-color-bg-interactive-neutral` | Background color for interactive elements with neutral tone and normal emphasis. |
Expand Down Expand Up @@ -60,6 +62,16 @@ Do not edit directly.
| `--wpds-color-bg-thumb-brand-disabled` | Background color for thumbs with a brand tone and normal emphasis (eg. slider thumb and filled track), in their disabled state. |
| `--wpds-color-fg-content-neutral` | Foreground color for content like text with normal emphasis. |
| `--wpds-color-fg-content-neutral-weak` | Foreground color for content like text with weak emphasis. |
| `--wpds-color-fg-content-success` | Foreground color for content like text with success tone and normal emphasis. |
| `--wpds-color-fg-content-success-weak` | Foreground color for content like text with success tone and weak emphasis. |
| `--wpds-color-fg-content-info` | Foreground color for content like text with info tone and normal emphasis. |
| `--wpds-color-fg-content-info-weak` | Foreground color for content like text with info tone and weak emphasis. |
| `--wpds-color-fg-content-warning` | Foreground color for content like text with warning tone and normal emphasis. |
| `--wpds-color-fg-content-warning-weak` | Foreground color for content like text with warning tone and weak emphasis. |
| `--wpds-color-fg-content-caution` | Foreground color for content like text with caution tone and normal emphasis. |
| `--wpds-color-fg-content-caution-weak` | Foreground color for content like text with caution tone and weak emphasis. |
| `--wpds-color-fg-content-error` | Foreground color for content like text with error tone and normal emphasis. |
| `--wpds-color-fg-content-error-weak` | Foreground color for content like text with error tone and weak emphasis. |
| `--wpds-color-fg-interactive-neutral` | Foreground color for interactive elements with neutral tone and normal emphasis. |
| `--wpds-color-fg-interactive-neutral-active` | Foreground color for interactive elements with neutral tone and normal emphasis that are hovered, focused, or active. |
| `--wpds-color-fg-interactive-neutral-disabled` | Foreground color for interactive elements with neutral tone and normal emphasis, in their disabled state. |
Expand Down Expand Up @@ -281,3 +293,25 @@ Do not edit directly.
| `--wpds-color-private-bg-bg-fill-inverted1` | N/A |
| `--wpds-color-private-bg-fg-fill-inverted` | N/A |
| `--wpds-color-private-bg-surface1` | N/A |
| `--wpds-color-private-caution-bg-fill1` | N/A |
| `--wpds-color-private-caution-fg-fill` | N/A |
| `--wpds-color-private-caution-bg-fill2` | N/A |
| `--wpds-color-private-caution-surface2` | N/A |
| `--wpds-color-private-caution-surface6` | N/A |
| `--wpds-color-private-caution-surface5` | N/A |
| `--wpds-color-private-caution-surface4` | N/A |
| `--wpds-color-private-caution-surface3` | N/A |
| `--wpds-color-private-caution-fg-surface4` | N/A |
| `--wpds-color-private-caution-fg-surface3` | N/A |
| `--wpds-color-private-caution-fg-surface2` | N/A |
| `--wpds-color-private-caution-fg-surface1` | N/A |
| `--wpds-color-private-caution-stroke3` | N/A |
| `--wpds-color-private-caution-stroke4` | N/A |
| `--wpds-color-private-caution-stroke2` | N/A |
| `--wpds-color-private-caution-stroke1` | N/A |
| `--wpds-color-private-caution-bg-fill-dark` | N/A |
| `--wpds-color-private-caution-fg-fill-dark` | N/A |
| `--wpds-color-private-caution-bg-fill-inverted2` | N/A |
| `--wpds-color-private-caution-bg-fill-inverted1` | N/A |
| `--wpds-color-private-caution-fg-fill-inverted` | N/A |
| `--wpds-color-private-caution-surface1` | N/A |
1 change: 1 addition & 0 deletions packages/theme/src/color-ramps/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const DEFAULT_SEED_COLORS = {
primary: '#3858e9',
info: '#0090ff',
success: '#4ab866',
caution: '#f0d149',
warning: '#f0b849',
error: '#cc1818',
};
8 changes: 8 additions & 0 deletions packages/theme/src/color-ramps/stories/index.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ export const Default: StoryObj< typeof ColorGen > = {
},
ramp: buildAccentRamp( DEFAULT_SEED_COLORS.warning, bgRamp ).ramp,
};
const cautionRampObj = {
seed: {
name: 'bgFill1' as const,
value: DEFAULT_SEED_COLORS.caution,
},
ramp: buildAccentRamp( DEFAULT_SEED_COLORS.caution, bgRamp ).ramp,
};
const errorRampObj = {
seed: {
name: 'bgFill1' as const,
Expand Down Expand Up @@ -109,6 +116,7 @@ export const Default: StoryObj< typeof ColorGen > = {
infoRampObj,
successRampObj,
warningRampObj,
cautionRampObj,
errorRampObj,
] }
/>
Expand Down
58 changes: 58 additions & 0 deletions packages/theme/src/prebuilt/css/design-tokens.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
--wpds-color-bg-surface-brand: var(
--wpds-color-private-primary-surface1
); /* Background color for surfaces with brand tone and normal emphasis. */
--wpds-color-bg-surface-caution: var(
--wpds-color-private-caution-surface4
); /* Background color for surfaces with caution tone and normal emphasis. */
--wpds-color-bg-surface-caution-weak: var(
--wpds-color-private-caution-surface2
); /* Background color for surfaces with caution tone and weak emphasis. */
--wpds-color-bg-surface-error: var(
--wpds-color-private-error-surface4
); /* Background color for surfaces with error tone and normal emphasis. */
Expand Down Expand Up @@ -111,12 +117,42 @@
--wpds-color-bg-track-neutral-weak: var(
--wpds-color-private-bg-stroke1
); /* Background color for tracks with a neutral tone and weak emphasis (eg. scrollbar track). */
--wpds-color-fg-content-caution: var(
--wpds-color-private-caution-fg-surface4
); /* Foreground color for content like text with caution tone and normal emphasis. */
--wpds-color-fg-content-caution-weak: var(
--wpds-color-private-caution-fg-surface3
); /* Foreground color for content like text with caution tone and weak emphasis. */
--wpds-color-fg-content-error: var(
--wpds-color-private-error-fg-surface4
); /* Foreground color for content like text with error tone and normal emphasis. */
--wpds-color-fg-content-error-weak: var(
--wpds-color-private-error-fg-surface3
); /* Foreground color for content like text with error tone and weak emphasis. */
--wpds-color-fg-content-info: var(
--wpds-color-private-info-fg-surface4
); /* Foreground color for content like text with info tone and normal emphasis. */
--wpds-color-fg-content-info-weak: var(
--wpds-color-private-info-fg-surface3
); /* Foreground color for content like text with info tone and weak emphasis. */
--wpds-color-fg-content-neutral: var(
--wpds-color-private-bg-fg-surface4
); /* Foreground color for content like text with normal emphasis. */
--wpds-color-fg-content-neutral-weak: var(
--wpds-color-private-bg-fg-surface3
); /* Foreground color for content like text with weak emphasis. */
--wpds-color-fg-content-success: var(
--wpds-color-private-success-fg-surface4
); /* Foreground color for content like text with success tone and normal emphasis. */
--wpds-color-fg-content-success-weak: var(
--wpds-color-private-success-fg-surface3
); /* Foreground color for content like text with success tone and weak emphasis. */
--wpds-color-fg-content-warning: var(
--wpds-color-private-warning-fg-surface4
); /* Foreground color for content like text with warning tone and normal emphasis. */
--wpds-color-fg-content-warning-weak: var(
--wpds-color-private-warning-fg-surface3
); /* Foreground color for content like text with warning tone and weak emphasis. */
--wpds-color-fg-interactive-brand: var(
--wpds-color-private-primary-fg-surface3
); /* Foreground color for interactive elements with brand tone and normal emphasis. */
Expand Down Expand Up @@ -181,6 +217,28 @@
--wpds-color-private-bg-surface4: #eaeaea;
--wpds-color-private-bg-surface5: #dfdfdf;
--wpds-color-private-bg-surface6: #d0d0d0;
--wpds-color-private-caution-bg-fill-dark: #1f1e1b;
--wpds-color-private-caution-bg-fill-inverted1: #3d2e00;
--wpds-color-private-caution-bg-fill-inverted2: #1f1e1b;
--wpds-color-private-caution-bg-fill1: #f0d149;
--wpds-color-private-caution-bg-fill2: #dabb2b;
--wpds-color-private-caution-fg-fill: #1f1e1b;
--wpds-color-private-caution-fg-fill-dark: #f6f1da;
--wpds-color-private-caution-fg-fill-inverted: #f6f1da;
--wpds-color-private-caution-fg-surface1: #c6a800;
--wpds-color-private-caution-fg-surface2: #a58700;
--wpds-color-private-caution-fg-surface3: #866a00;
--wpds-color-private-caution-fg-surface4: #291d00;
--wpds-color-private-caution-stroke1: #b8ab76;
--wpds-color-private-caution-stroke2: #988d61;
--wpds-color-private-caution-stroke3: #866a00;
--wpds-color-private-caution-stroke4: #644e00;
--wpds-color-private-caution-surface1: #faf1cb;
--wpds-color-private-caution-surface2: #fdf9e7;
--wpds-color-private-caution-surface3: #ffffff;
--wpds-color-private-caution-surface4: #f8ebb6;
--wpds-color-private-caution-surface5: #f4df8c;
--wpds-color-private-caution-surface6: #e7d072;
--wpds-color-private-error-bg-fill-dark: #231c1b;
--wpds-color-private-error-bg-fill-inverted1: #6d0000;
--wpds-color-private-error-bg-fill-inverted2: #231c1b;
Expand Down
12 changes: 12 additions & 0 deletions packages/theme/src/prebuilt/js/design-tokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export default [
'--wpds-color-bg-surface-info-weak',
'--wpds-color-bg-surface-warning',
'--wpds-color-bg-surface-warning-weak',
'--wpds-color-bg-surface-caution',
'--wpds-color-bg-surface-caution-weak',
'--wpds-color-bg-surface-error',
'--wpds-color-bg-surface-error-weak',
'--wpds-color-bg-interactive-neutral',
Expand Down Expand Up @@ -48,6 +50,16 @@ export default [
'--wpds-color-bg-thumb-brand-disabled',
'--wpds-color-fg-content-neutral',
'--wpds-color-fg-content-neutral-weak',
'--wpds-color-fg-content-success',
'--wpds-color-fg-content-success-weak',
'--wpds-color-fg-content-info',
'--wpds-color-fg-content-info-weak',
'--wpds-color-fg-content-warning',
'--wpds-color-fg-content-warning-weak',
'--wpds-color-fg-content-caution',
'--wpds-color-fg-content-caution-weak',
'--wpds-color-fg-content-error',
'--wpds-color-fg-content-error-weak',
'--wpds-color-fg-interactive-neutral',
'--wpds-color-fg-interactive-neutral-active',
'--wpds-color-fg-interactive-neutral-disabled',
Expand Down
182 changes: 182 additions & 0 deletions packages/theme/src/prebuilt/json/figma.json
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,116 @@
".": "#efefef"
}
},
"Color/_Primitives/Caution/bgFill1": {
"value": {
".": "#f0d149"
}
},
"Color/_Primitives/Caution/fgFill": {
"value": {
".": "#1f1e1b"
}
},
"Color/_Primitives/Caution/bgFill2": {
"value": {
".": "#dabb2b"
}
},
"Color/_Primitives/Caution/surface2": {
"value": {
".": "#fdf9e7"
}
},
"Color/_Primitives/Caution/surface6": {
"value": {
".": "#e7d072"
}
},
"Color/_Primitives/Caution/surface5": {
"value": {
".": "#f4df8c"
}
},
"Color/_Primitives/Caution/surface4": {
"value": {
".": "#f8ebb6"
}
},
"Color/_Primitives/Caution/surface3": {
"value": {
".": "#fff"
}
},
"Color/_Primitives/Caution/fgSurface4": {
"value": {
".": "#291d00"
}
},
"Color/_Primitives/Caution/fgSurface3": {
"value": {
".": "#866a00"
}
},
"Color/_Primitives/Caution/fgSurface2": {
"value": {
".": "#a58700"
}
},
"Color/_Primitives/Caution/fgSurface1": {
"value": {
".": "#c6a800"
}
},
"Color/_Primitives/Caution/stroke3": {
"value": {
".": "#866a00"
}
},
"Color/_Primitives/Caution/stroke4": {
"value": {
".": "#644e00"
}
},
"Color/_Primitives/Caution/stroke2": {
"value": {
".": "#988d61"
}
},
"Color/_Primitives/Caution/stroke1": {
"value": {
".": "#b8ab76"
}
},
"Color/_Primitives/Caution/bgFillDark": {
"value": {
".": "#1f1e1b"
}
},
"Color/_Primitives/Caution/fgFillDark": {
"value": {
".": "#f6f1da"
}
},
"Color/_Primitives/Caution/bgFillInverted2": {
"value": {
".": "#1f1e1b"
}
},
"Color/_Primitives/Caution/bgFillInverted1": {
"value": {
".": "#3d2e00"
}
},
"Color/_Primitives/Caution/fgFillInverted": {
"value": {
".": "#f6f1da"
}
},
"Color/_Primitives/Caution/surface1": {
"value": {
".": "#faf1cb"
}
},
"Color/Semantic/Background/Neutral/bgSur-neutral": {
"value": {
".": "{Color/_Primitives/Bg/surface2}"
Expand Down Expand Up @@ -750,6 +860,18 @@
},
"description": "Background color for surfaces with warning tone and weak emphasis."
},
"Color/Semantic/Background/Caution/bgSur-caution": {
"value": {
".": "{Color/_Primitives/Caution/surface4}"
},
"description": "Background color for surfaces with caution tone and normal emphasis."
},
"Color/Semantic/Background/Caution/bgSur-caution-weak": {
"value": {
".": "{Color/_Primitives/Caution/surface2}"
},
"description": "Background color for surfaces with caution tone and weak emphasis."
},
"Color/Semantic/Background/Error/bgSur-error": {
"value": {
".": "{Color/_Primitives/Error/surface4}"
Expand Down Expand Up @@ -924,6 +1046,66 @@
},
"description": "Foreground color for content like text with weak emphasis."
},
"Color/Semantic/Foreground/Success/fgCon-success": {
"value": {
".": "{Color/_Primitives/Success/fgSurface4}"
},
"description": "Foreground color for content like text with success tone and normal emphasis."
},
"Color/Semantic/Foreground/Success/fgCon-success-weak": {
"value": {
".": "{Color/_Primitives/Success/fgSurface3}"
},
"description": "Foreground color for content like text with success tone and weak emphasis."
},
"Color/Semantic/Foreground/Info/fgCon-info": {
"value": {
".": "{Color/_Primitives/Info/fgSurface4}"
},
"description": "Foreground color for content like text with info tone and normal emphasis."
},
"Color/Semantic/Foreground/Info/fgCon-info-weak": {
"value": {
".": "{Color/_Primitives/Info/fgSurface3}"
},
"description": "Foreground color for content like text with info tone and weak emphasis."
},
"Color/Semantic/Foreground/Warning/fgCon-warning": {
"value": {
".": "{Color/_Primitives/Warning/fgSurface4}"
},
"description": "Foreground color for content like text with warning tone and normal emphasis."
},
"Color/Semantic/Foreground/Warning/fgCon-warning-weak": {
"value": {
".": "{Color/_Primitives/Warning/fgSurface3}"
},
"description": "Foreground color for content like text with warning tone and weak emphasis."
},
"Color/Semantic/Foreground/Caution/fgCon-caution": {
"value": {
".": "{Color/_Primitives/Caution/fgSurface4}"
},
"description": "Foreground color for content like text with caution tone and normal emphasis."
},
"Color/Semantic/Foreground/Caution/fgCon-caution-weak": {
"value": {
".": "{Color/_Primitives/Caution/fgSurface3}"
},
"description": "Foreground color for content like text with caution tone and weak emphasis."
},
"Color/Semantic/Foreground/Error/fgCon-error": {
"value": {
".": "{Color/_Primitives/Error/fgSurface4}"
},
"description": "Foreground color for content like text with error tone and normal emphasis."
},
"Color/Semantic/Foreground/Error/fgCon-error-weak": {
"value": {
".": "{Color/_Primitives/Error/fgSurface3}"
},
"description": "Foreground color for content like text with error tone and weak emphasis."
},
"Color/Semantic/Foreground/Neutral/fgInt-neutral": {
"value": {
".": "{Color/_Primitives/Bg/fgSurface4}"
Expand Down
Loading