Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add status color tokens #124

Merged
merged 9 commits into from
Jan 15, 2024
22 changes: 22 additions & 0 deletions .changeset/rich-bags-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
"@rhds/tokens": minor
---

Added status tokens

```css
button {
.light &.danger {
background: var(--rh-color-danger-on-light);
}
.light &.success {
background: var(--rh-color-success-on-light);
}
.dark &.danger {
background: var(--rh-color-danger-on-dark);
}
.dark &.success {
background: var(--rh-color-success-on-dark);
}
}
```
2 changes: 1 addition & 1 deletion docs/assets/tokens.css
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ code {
.token:is(.value, .name) .copy-button {
background-color: var(--rh-color-surface-lighter);
overflow-x: hidden;
max-width: 350px;
max-width: 400px;
white-space: pre;
text-overflow: ellipsis;
}
Expand Down
69 changes: 68 additions & 1 deletion tokens/color/border.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,71 @@ color:
$description: Interactive border color (dark theme)
attributes:
category: border
type: color
type: color

status:
danger:
on-light:
$value: '{color.red-orange.50}'
$description: Danger status border color (light theme)
attributes:
category: border
type: color
on-dark:
$value: '{color.red-orange.40}'
$description: Danger status border color (dark theme)
attributes:
category: border
type: color
warning:
on-light:
$value: '{color.orange.50}'
$description: Warning status border color (light theme)
attributes:
category: border
type: color
on-dark:
$value: '{color.orange.40}'
$description: Warning status border color (dark theme)
attributes:
category: border
type: color
default:
on-light:
$value: '{color.gray.60}'
$description: Default status border color (light theme)
attributes:
category: border
type: color
on-dark:
$value: '{color.gray.40}'
$description: Default status border color (dark theme)
attributes:
category: border
type: color
info:
on-light:
$value: '{color.purple.50}'
$description: Info status border color (light theme)
attributes:
category: border
type: color
on-dark:
$value: '{color.purple.30}'
$description: Info status border color (dark theme)
attributes:
category: border
type: color
success:
on-light:
$value: '{color.green.60}'
$description: Success status border color (light theme)
attributes:
category: border
type: color
on-dark:
$value: '{color.green.40}'
$description: Success status border color (dark theme)
attributes:
category: border
type: color
2 changes: 1 addition & 1 deletion tokens/color/crayon/blue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ color:
blue:
$extensions:
com.redhat.ux:
order: 301
order: 306
10:
$value: '#E0F0FF'
$description: Alert - Info background
Expand Down
2 changes: 1 addition & 1 deletion tokens/color/crayon/orange.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ color:
orange:
$extensions:
com.redhat.ux:
order: 305
order: 302
10:
$value: '#FFE8CC'
$description: Label - Filled (Orange) background color
Expand Down
2 changes: 1 addition & 1 deletion tokens/color/crayon/purple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ color:
purple:
$extensions:
com.redhat.ux:
order: 306
order: 307
10:
$value: '#ECE6FF'
$description: Label - Filled (Purple) background color
Expand Down
4 changes: 2 additions & 2 deletions tokens/color/crayon/red-orange.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ color:
red-orange:
$extensions:
com.redhat.ux:
order: 303
order: 301
description: >-
The red orange color is reserved for danger or error states. Do not use it anywhere else.
Expand All @@ -15,7 +15,7 @@ color:
40:
$value: '#F4784A'
50:
$value: '#F4784A'
$value: '#F0561D'
60:
$value: '#B1380B'
70:
Expand Down
2 changes: 1 addition & 1 deletion tokens/color/crayon/teal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ color:
teal:
$extensions:
com.redhat.ux:
order: 302
order: 305
10:
$value: '#DAF2F2'
$description: Alert - Default background
Expand Down
45 changes: 45 additions & 0 deletions tokens/color/status.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
color:
status:
$extensions:
com.redhat.ux:
order: 500

danger:
on-light:
$value: '{color.red-orange.50}'
$description: Danger accent color (light theme)
marionnegp marked this conversation as resolved.
Show resolved Hide resolved
on-dark:
$value: '{color.red-orange.40}'
$description: Danger accent color (dark theme)

warning:
on-light:
$value: '{color.orange.50}'
$description: Warning accent color (light theme)
on-dark:
$value: '{color.orange.40}'
$description: Warning accent color (dark theme)

default:
on-light:
$value: '{color.gray.60}'
$description: Default accent color (light theme)
on-dark:
$value: '{color.gray.40}'
$description: Default accent color (dark theme)

info:
on-light:
$value: '{color.purple.50}'
$description: Info accent color (light theme)
on-dark:
$value: '{color.purple.30}'
$description: Info accent color (dark theme)

success:
on-light:
$value: '{color.green.60}'
$description: Success accent color (light theme)
on-dark:
$value: '{color.green.40}'
$description: Success accent color (dark theme)
37 changes: 37 additions & 0 deletions tokens/color/surface.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,40 @@ color:
darkest:
$value: '{color.gray.95}'
$description: Primary surface (dark theme)

status:
bennypowers marked this conversation as resolved.
Show resolved Hide resolved
danger:
on-light:
$value: '{color.red-orange.10}'
$description: Danger status surface color (light theme)
on-dark:
$value: '{color.red-orange.70}'
$description: Danger status surface color (dark theme)
warning:
on-light:
$value: '{color.orange.10}'
$description: Warning status surface color (light theme)
on-dark:
$value: '{color.orange.70}'
$description: Warning status surface color (dark theme)
default:
on-light:
$value: '{color.gray.10}'
$description: Default status surface color (light theme)
on-dark:
$value: '{color.gray.80}'
$description: Default status surface color (dark theme)
info:
on-light:
$value: '{color.purple.10}'
$description: Info status surface color (light theme)
on-dark:
$value: '{color.purple.60}'
$description: Info status surface color (dark theme)
success:
on-light:
$value: '{color.green.10}'
$description: Success status surface color (light theme)
on-dark:
$value: '{color.green.70}'
$description: Success status surface color (dark theme)