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

[Visual Refresh] Update EuiToken colors #8250

Merged
merged 2 commits into from
Dec 19, 2024
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 packages/eui/src/components/token/token.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const getTokenColor = (
: euiTheme.colors.darkShade;

const backgroundLightColor = isDarkMode
? shade(iconColor, 0.7)
? shade(iconColor, 0.9)
Copy link
Contributor

Choose a reason for hiding this comment

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

If we change the value like this, it will affect Amsterdam colors as well.
We're in the process of adding Borealis enabled EUI packages to 8.x also where this change would apply as well then.

If we don't want Amsterdam to change, we'll need to address this conditionally.

Also fyi, this is one of the few places shade/tint are still in use since there wasn't a clear guideline on those colors yet, so it's great to hear there will be some definitions in the future 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, of course!
I'll see how it looks in Amsterdam... perhaps it is subtle enough to allow for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked the token.styles.ts changes in Amsterdam, and they are subtle.

In my estimation, it seems likely to go unnoticed and, better yet, improves the contrast in Amsterdam too. I am personally comfortable with moving ahead with this minor change, as is, and foregoing the conditional check.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree, the change is subtle and actually improves visibility 👍

: tint(iconColor, 0.9);

const getIconVisColor = (
Expand All @@ -68,12 +68,12 @@ const getTokenColor = (
const lightColor = hasVisColorAdjustment
? makeHighContrastColor(iconColor)(backgroundLightColor)
: isVizColor
? getIconVisColor(euiTheme, color)
? shade(getIconVisColor(euiTheme, color), 0.3)
: iconColor;

const boxShadowColor = isDarkMode
? shade(iconColor, 0.6)
: tint(iconColor, 0.7);
: tint(iconColor, 0.2);

const darkColor = isColorDark(...chroma(backgroundDarkColor).rgb())
? euiTheme.colors.ghost
Expand Down
48 changes: 24 additions & 24 deletions packages/eui/src/components/token/token_map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,24 +310,24 @@ export const TOKEN_MAP_BOREALIS: {
[mapType in EuiTokenMapType]: Omit<TokenProps, 'iconType'>;
} = {
tokenAlias: {
shape: 'circle',
color: 'euiColorVis1',
shape: 'square',
color: 'euiColorVis0',
},
tokenAnnotation: {
shape: 'square',
color: 'euiColorVis8',
},
tokenArray: {
shape: 'square',
color: 'euiColorVis3',
color: 'euiColorVis4',
},
tokenBinary: {
shape: 'square',
color: 'euiColorVis5',
color: 'euiColorVis6',
},
tokenBoolean: {
shape: 'square',
color: 'euiColorVis3',
color: 'euiColorVis4',
},
tokenClass: {
shape: 'circle',
Expand All @@ -343,27 +343,27 @@ export const TOKEN_MAP_BOREALIS: {
},
tokenDate: {
shape: 'square',
color: 'euiColorVis9',
color: 'euiColorVis8',
},
tokenDimension: {
shape: 'square',
color: 'euiColorVis2',
},
tokenElement: {
shape: 'square',
color: 'euiColorVis1',
color: 'euiColorVis0',
},
tokenEnum: {
shape: 'circle',
color: 'euiColorVis1',
color: 'euiColorVis0',
},
tokenEnumMember: {
shape: 'square',
color: 'euiColorVis3',
color: 'euiColorVis4',
},
tokenEvent: {
shape: 'circle',
color: 'euiColorVis5',
color: 'euiColorVis6',
},
tokenException: {
shape: 'circle',
Expand All @@ -379,7 +379,7 @@ export const TOKEN_MAP_BOREALIS: {
},
tokenFlattened: {
shape: 'square',
color: 'euiColorVis3',
color: 'euiColorVis4',
},
tokenFunction: {
shape: 'circle',
Expand All @@ -391,7 +391,7 @@ export const TOKEN_MAP_BOREALIS: {
},
tokenHistogram: {
shape: 'square',
color: 'euiColorVis9',
color: 'euiColorVis0',
},
tokenInterface: {
shape: 'circle',
Expand Down Expand Up @@ -427,7 +427,7 @@ export const TOKEN_MAP_BOREALIS: {
},
tokenModule: {
shape: 'square',
color: 'euiColorVis5',
color: 'euiColorVis6',
},
tokenNamespace: {
shape: 'square',
Expand All @@ -447,39 +447,39 @@ export const TOKEN_MAP_BOREALIS: {
},
tokenObject: {
shape: 'circle',
color: 'euiColorVis1',
color: 'euiColorVis0',
},
tokenOperator: {
shape: 'circle',
color: 'euiColorVis5',
color: 'euiColorVis6',
},
tokenPackage: {
shape: 'square',
color: 'euiColorVis0',
},
tokenParameter: {
shape: 'square',
color: 'euiColorVis5',
color: 'euiColorVis6',
},
tokenPercolator: {
shape: 'square',
color: 'euiColorVis9',
color: 'euiColorVis0',
},
tokenProperty: {
shape: 'circle',
color: 'euiColorVis4',
},
tokenRange: {
shape: 'circle',
color: 'euiColorVis5',
color: 'euiColorVis6',
},
tokenRankFeature: {
shape: 'square',
color: 'euiColorVis7',
color: 'euiColorVis8',
},
tokenRankFeatures: {
shape: 'square',
color: 'euiColorVis1',
color: 'euiColorVis0',
},
tokenRepo: {
shape: 'square',
Expand All @@ -495,7 +495,7 @@ export const TOKEN_MAP_BOREALIS: {
},
tokenShape: {
shape: 'circle',
color: 'euiColorVis7',
color: 'euiColorVis8',
},
tokenString: {
shape: 'square',
Expand All @@ -515,15 +515,15 @@ export const TOKEN_MAP_BOREALIS: {
},
tokenText: {
shape: 'square',
color: 'euiColorVis1',
color: 'euiColorVis0',
},
tokenTokenCount: {
shape: 'square',
color: 'euiColorVis5',
color: 'euiColorVis6',
},
tokenVariable: {
shape: 'circle',
color: 'euiColorVis3',
color: 'euiColorVis4',
},
tokenVectorDense: {
shape: 'square',
Expand Down