Skip to content

FCT 1514 - Accessibility Adjustments #3116

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

Merged
merged 2 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions design-system/materials/custom-properties.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
--color-accent-98: hsl(195, 100%, 98%);
--color-brown-10: hsl(41, 100%, 10%);
--color-brown-20: hsl(41, 100%, 20%);
--color-brown-35: hsl(41, 96%, 35%);
--color-brown-35: hsl(41, 96%, 30%);
Copy link
Contributor Author

@valoriecarli valoriecarli May 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FilPob, @misama-ct i noticed that the vast majority of the property names (not all) match the light value.
would you like for these to follow that format, or no? figma didn't have this, so wanted to check before i became too creative.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, please don’t. The old token-/color-system is flawed. HSL is a rather mathematical, not a 100% perceptual colorspace. This means the “lightness” channel in hsl is not actually reflecting a uniform lightness value across the colorspace.

--color-brown-50: hsl(41, 95%, 44%);
--color-brown-70: hsl(47, 95%, 70%);
--color-brown-85: hsl(47, 100%, 85%);
Expand All @@ -47,7 +47,7 @@
--color-purple-98: hsl(246, 100%, 98%);
--color-turquoise-10: hsl(180, 88%, 10%);
--color-turquoise-20: hsl(180, 90%, 20%);
--color-turquoise-35: hsl(178, 88%, 35%);
--color-turquoise-35: hsl(178, 88%, 25%);
--color-turquoise-50: hsl(178, 67%, 50%);
--color-turquoise-70: hsl(180, 75%, 70%);
--color-turquoise-85: hsl(180, 90%, 85%);
Expand All @@ -65,7 +65,7 @@
--color-neutral-95: hsl(232, 18%, 95%);
--color-neutral-98: hsl(232, 18%, 98%);
--color-info: #078cdf;
--color-info-40: hsl(203.05555555555554, 93.9130434783%, 40%);
--color-info-40: hsl(203, 94%, 35%);
--color-info-50: hsl(203.05555555555554, 93.9130434783%, 50%);
--color-info-60: hsl(203.05555555555554, 93.9130434783%, 60%);
--color-info-85: hsl(203.05555555555554, 93.9130434783%, 85%);
Expand Down
6 changes: 3 additions & 3 deletions design-system/materials/custom-properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"--color-accent-98": "hsl(195, 100%, 98%)",
"--color-brown-10": "hsl(41, 100%, 10%)",
"--color-brown-20": "hsl(41, 100%, 20%)",
"--color-brown-35": "hsl(41, 96%, 35%)",
"--color-brown-35": "hsl(41, 96%, 30%)",
"--color-brown-50": "hsl(41, 95%, 44%)",
"--color-brown-70": "hsl(47, 95%, 70%)",
"--color-brown-85": "hsl(47, 100%, 85%)",
Expand All @@ -40,7 +40,7 @@
"--color-purple-98": "hsl(246, 100%, 98%)",
"--color-turquoise-10": "hsl(180, 88%, 10%)",
"--color-turquoise-20": "hsl(180, 90%, 20%)",
"--color-turquoise-35": "hsl(178, 88%, 35%)",
"--color-turquoise-35": "hsl(178, 88%, 25%)",
"--color-turquoise-50": "hsl(178, 67%, 50%)",
"--color-turquoise-70": "hsl(180, 75%, 70%)",
"--color-turquoise-85": "hsl(180, 90%, 85%)",
Expand All @@ -58,7 +58,7 @@
"--color-neutral-95": "hsl(232, 18%, 95%)",
"--color-neutral-98": "hsl(232, 18%, 98%)",
"--color-info": "#078cdf",
"--color-info-40": "hsl(203.05555555555554, 93.9130434783%, 40%)",
"--color-info-40": "hsl(203, 94%, 35%)",
"--color-info-50": "hsl(203.05555555555554, 93.9130434783%, 50%)",
"--color-info-60": "hsl(203.05555555555554, 93.9130434783%, 60%)",
"--color-info-85": "hsl(203.05555555555554, 93.9130434783%, 85%)",
Expand Down
6 changes: 3 additions & 3 deletions design-system/materials/custom-properties_default.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
--color-accent-98: hsl(195, 100%, 98%);
--color-brown-10: hsl(41, 100%, 10%);
--color-brown-20: hsl(41, 100%, 20%);
--color-brown-35: hsl(41, 96%, 35%);
--color-brown-35: hsl(41, 96%, 30%);
--color-brown-50: hsl(41, 95%, 44%);
--color-brown-70: hsl(47, 95%, 70%);
--color-brown-85: hsl(47, 100%, 85%);
Expand All @@ -47,7 +47,7 @@
--color-purple-98: hsl(246, 100%, 98%);
--color-turquoise-10: hsl(180, 88%, 10%);
--color-turquoise-20: hsl(180, 90%, 20%);
--color-turquoise-35: hsl(178, 88%, 35%);
--color-turquoise-35: hsl(178, 88%, 25%);
--color-turquoise-50: hsl(178, 67%, 50%);
--color-turquoise-70: hsl(180, 75%, 70%);
--color-turquoise-85: hsl(180, 90%, 85%);
Expand All @@ -65,7 +65,7 @@
--color-neutral-95: hsl(232, 18%, 95%);
--color-neutral-98: hsl(232, 18%, 98%);
--color-info: #078cdf;
--color-info-40: hsl(203.05555555555554, 93.9130434783%, 40%);
--color-info-40: hsl(203, 94%, 35%);
--color-info-50: hsl(203.05555555555554, 93.9130434783%, 50%);
--color-info-60: hsl(203.05555555555554, 93.9130434783%, 60%);
--color-info-85: hsl(203.05555555555554, 93.9130434783%, 85%);
Expand Down
6 changes: 3 additions & 3 deletions design-system/materials/internals/definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ choiceGroupsByTheme:
color-accent-98: 'hsl(195, 100%, 98%)'
color-brown-10: 'hsl(41, 100%, 10%)'
color-brown-20: 'hsl(41, 100%, 20%)'
color-brown-35: 'hsl(41, 96%, 35%)'
color-brown-35: 'hsl(41, 96%, 30%)'
color-brown-50: 'hsl(41, 95%, 44%)'
color-brown-70: 'hsl(47, 95%, 70%)'
color-brown-85: 'hsl(47, 100%, 85%)'
Expand All @@ -77,7 +77,7 @@ choiceGroupsByTheme:
color-purple-98: 'hsl(246, 100%, 98%)'
color-turquoise-10: 'hsl(180, 88%, 10%)'
color-turquoise-20: 'hsl(180, 90%, 20%)'
color-turquoise-35: 'hsl(178, 88%, 35%)'
color-turquoise-35: 'hsl(178, 88%, 25%)'
color-turquoise-50: 'hsl(178, 67%, 50%)'
color-turquoise-70: 'hsl(180, 75%, 70%)'
color-turquoise-85: 'hsl(180, 90%, 85%)'
Expand All @@ -95,7 +95,7 @@ choiceGroupsByTheme:
color-neutral-95: 'hsl(232, 18%, 95%)'
color-neutral-98: 'hsl(232, 18%, 98%)'
color-info: '#078cdf'
color-info-40: 'hsl(203.05555555555554, 93.9130434783%, 40%)'
color-info-40: 'hsl(203, 94%, 35%)'
color-info-50: 'hsl(203.05555555555554, 93.9130434783%, 50%)'
color-info-60: 'hsl(203.05555555555554, 93.9130434783%, 60%)'
color-info-85: 'hsl(203.05555555555554, 93.9130434783%, 85%)'
Expand Down
13 changes: 6 additions & 7 deletions design-system/src/design-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const themes = {
colorAccent98: 'hsl(195, 100%, 98%)',
colorBrown10: 'hsl(41, 100%, 10%)',
colorBrown20: 'hsl(41, 100%, 20%)',
colorBrown35: 'hsl(41, 96%, 35%)',
colorBrown35: 'hsl(41, 96%, 30%)',
colorBrown50: 'hsl(41, 95%, 44%)',
colorBrown70: 'hsl(47, 95%, 70%)',
colorBrown85: 'hsl(47, 100%, 85%)',
Expand All @@ -46,7 +46,7 @@ export const themes = {
colorPurple98: 'hsl(246, 100%, 98%)',
colorTurquoise10: 'hsl(180, 88%, 10%)',
colorTurquoise20: 'hsl(180, 90%, 20%)',
colorTurquoise35: 'hsl(178, 88%, 35%)',
colorTurquoise35: 'hsl(178, 88%, 25%)',
colorTurquoise50: 'hsl(178, 67%, 50%)',
colorTurquoise70: 'hsl(180, 75%, 70%)',
colorTurquoise85: 'hsl(180, 90%, 85%)',
Expand All @@ -64,7 +64,7 @@ export const themes = {
colorNeutral95: 'hsl(232, 18%, 95%)',
colorNeutral98: 'hsl(232, 18%, 98%)',
colorInfo: '#078cdf',
colorInfo40: 'hsl(203.05555555555554, 93.9130434783%, 40%)',
colorInfo40: 'hsl(203, 94%, 35%)',
colorInfo50: 'hsl(203.05555555555554, 93.9130434783%, 50%)',
colorInfo60: 'hsl(203.05555555555554, 93.9130434783%, 60%)',
colorInfo85: 'hsl(203.05555555555554, 93.9130434783%, 85%)',
Expand Down Expand Up @@ -260,7 +260,7 @@ const designTokens = {
colorAccent98: 'var(--color-accent-98, hsl(195, 100%, 98%))',
colorBrown10: 'var(--color-brown-10, hsl(41, 100%, 10%))',
colorBrown20: 'var(--color-brown-20, hsl(41, 100%, 20%))',
colorBrown35: 'var(--color-brown-35, hsl(41, 96%, 35%))',
colorBrown35: 'var(--color-brown-35, hsl(41, 96%, 30%))',
colorBrown50: 'var(--color-brown-50, hsl(41, 95%, 44%))',
colorBrown70: 'var(--color-brown-70, hsl(47, 95%, 70%))',
colorBrown85: 'var(--color-brown-85, hsl(47, 100%, 85%))',
Expand All @@ -278,7 +278,7 @@ const designTokens = {
colorPurple98: 'var(--color-purple-98, hsl(246, 100%, 98%))',
colorTurquoise10: 'var(--color-turquoise-10, hsl(180, 88%, 10%))',
colorTurquoise20: 'var(--color-turquoise-20, hsl(180, 90%, 20%))',
colorTurquoise35: 'var(--color-turquoise-35, hsl(178, 88%, 35%))',
colorTurquoise35: 'var(--color-turquoise-35, hsl(178, 88%, 25%))',
colorTurquoise50: 'var(--color-turquoise-50, hsl(178, 67%, 50%))',
colorTurquoise70: 'var(--color-turquoise-70, hsl(180, 75%, 70%))',
colorTurquoise85: 'var(--color-turquoise-85, hsl(180, 90%, 85%))',
Expand All @@ -296,8 +296,7 @@ const designTokens = {
colorNeutral95: 'var(--color-neutral-95, hsl(232, 18%, 95%))',
colorNeutral98: 'var(--color-neutral-98, hsl(232, 18%, 98%))',
colorInfo: 'var(--color-info, #078cdf)',
colorInfo40:
'var(--color-info-40, hsl(203.05555555555554, 93.9130434783%, 40%))',
colorInfo40: 'var(--color-info-40, hsl(203, 94%, 35%))',
colorInfo50:
'var(--color-info-50, hsl(203.05555555555554, 93.9130434783%, 50%))',
colorInfo60:
Expand Down
11 changes: 5 additions & 6 deletions packages/components/avatar/src/avatar.styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { designTokens } from '@commercetools-uikit/design-system';
import { css } from '@emotion/react';
import startCase from 'lodash/startCase';
import { TAvatarProps } from './avatar';

const fontSizeMap = {
Expand Down Expand Up @@ -61,14 +60,14 @@ export const getBackgroundColor = (

export const getForegroundColor = (avatarColor: TAvatarProps['color']) => {
switch (avatarColor) {
case 'accent':
return designTokens.colorAccent40;
case 'brown':
return designTokens.colorBrown35;
case 'purple':
return designTokens.colorPurple50;
case 'turquoise':
return designTokens.colorTurquoise35;
default:
return designTokens[
`color${startCase(avatarColor)}50` as keyof typeof designTokens
];
return designTokens.colorAccent30;
Comment on lines +63 to +70
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brown & accent no longer share the same lightness value (50%), so i left accent as the default to match the readme file.

}
};

Expand Down
Loading