Skip to content

Commit

Permalink
feat: add new grey tone to fix accessibility issues (#2873)
Browse files Browse the repository at this point in the history
* feat: new design token added (color-neutral-50)

* fix: update color for tertiary text to reach AA contrast goal on default bg colors
  • Loading branch information
misama-ct authored Aug 5, 2024
1 parent ea4a283 commit 82e5e2a
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/fair-tools-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-uikit/design-system': minor
---

new color token color-neutral-50 added
5 changes: 5 additions & 0 deletions .changeset/perfect-games-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@commercetools-uikit/text': patch
---

fixed insufficient fg to bg contrast-ratio when using text with tertiary tone
1 change: 1 addition & 0 deletions design-system/materials/custom-properties.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
--color-neutral-05: hsl(0deg 0% 80% / 5%);
--color-neutral-10: hsl(0deg 0% 80% / 10%);
--color-neutral-40: hsl(232, 18%, 40%);
--color-neutral-50: hsl(233, 18%, 50%);
--color-neutral-60: hsl(232, 18%, 60%);
--color-neutral-85: hsl(232, 18%, 85%);
--color-neutral-90: hsl(232, 18%, 90%);
Expand Down
1 change: 1 addition & 0 deletions design-system/materials/custom-properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"--color-neutral-05": "hsl(0deg 0% 80% / 5%)",
"--color-neutral-10": "hsl(0deg 0% 80% / 10%)",
"--color-neutral-40": "hsl(232, 18%, 40%)",
"--color-neutral-50": "hsl(233, 18%, 50%)",
"--color-neutral-60": "hsl(232, 18%, 60%)",
"--color-neutral-85": "hsl(232, 18%, 85%)",
"--color-neutral-90": "hsl(232, 18%, 90%)",
Expand Down
1 change: 1 addition & 0 deletions design-system/materials/custom-properties_default.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
--color-neutral-05: hsl(0deg 0% 80% / 5%);
--color-neutral-10: hsl(0deg 0% 80% / 10%);
--color-neutral-40: hsl(232, 18%, 40%);
--color-neutral-50: hsl(233, 18%, 50%);
--color-neutral-60: hsl(232, 18%, 60%);
--color-neutral-85: hsl(232, 18%, 85%);
--color-neutral-90: hsl(232, 18%, 90%);
Expand Down
3 changes: 3 additions & 0 deletions design-system/materials/internals/definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ choiceGroupsByTheme:
color-neutral-05: 'hsl(0deg 0% 80% / 5%)'
color-neutral-10: 'hsl(0deg 0% 80% / 10%)'
color-neutral-40: 'hsl(232, 18%, 40%)'
color-neutral-50: 'hsl(233, 18%, 50%)'
color-neutral-60: 'hsl(232, 18%, 60%)'
color-neutral-85: 'hsl(232, 18%, 85%)'
color-neutral-90: 'hsl(232, 18%, 90%)'
Expand Down Expand Up @@ -301,6 +302,8 @@ variants:
description: 'To differentiate component big size'
secondary:
description: 'To differentiate component secondary type'
tertiary:
description: 'To differentiate component tertiary type'
'10':
description: 'To differentiate component small size'
'20':
Expand Down
2 changes: 2 additions & 0 deletions design-system/src/design-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export const themes = {
colorNeutral05: 'hsl(0deg 0% 80% / 5%)',
colorNeutral10: 'hsl(0deg 0% 80% / 10%)',
colorNeutral40: 'hsl(232, 18%, 40%)',
colorNeutral50: 'hsl(233, 18%, 50%)',
colorNeutral60: 'hsl(232, 18%, 60%)',
colorNeutral85: 'hsl(232, 18%, 85%)',
colorNeutral90: 'hsl(232, 18%, 90%)',
Expand Down Expand Up @@ -287,6 +288,7 @@ const designTokens = {
colorNeutral05: 'var(--color-neutral-05, hsl(0deg 0% 80% / 5%))',
colorNeutral10: 'var(--color-neutral-10, hsl(0deg 0% 80% / 10%))',
colorNeutral40: 'var(--color-neutral-40, hsl(232, 18%, 40%))',
colorNeutral50: 'var(--color-neutral-50, hsl(233, 18%, 50%))',
colorNeutral60: 'var(--color-neutral-60, hsl(232, 18%, 60%))',
colorNeutral85: 'var(--color-neutral-85, hsl(232, 18%, 85%))',
colorNeutral90: 'var(--color-neutral-90, hsl(232, 18%, 90%))',
Expand Down
2 changes: 1 addition & 1 deletion packages/components/text/src/text.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const getTone = (tone: string) => {
case 'critical':
return `color: ${designTokens.colorError40};`;
case 'tertiary':
return `color: ${designTokens.colorNeutral60};`;
return `color: ${designTokens.colorNeutral50};`;
case 'inherit':
return 'color: inherit;';
default:
Expand Down

0 comments on commit 82e5e2a

Please sign in to comment.