Skip to content

Commit eb3e12e

Browse files
[Colors] Create text-ink and text-ghost tokens (#9379)
1 parent 827019f commit eb3e12e

File tree

47 files changed

+112
-110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+112
-110
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- Added `textInk` and `textGhost` color tokens for text and icon colors that should always remain dark or light regardless of color mode.
2+
3+
**Breaking changes**
4+
5+
- Removed `ink` and `ghost` theme tokens. Use `textInk` / `textGhost` for text and icon colors or `plainDark` /`plainLight` for non-text use cases.

packages/eui-theme-borealis/src/eui_theme_borealis_dark.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,6 @@
354354
"euiColorSeverityDanger": "#EE4C48",
355355
"euiColorChartLines": "#7186A8",
356356
"euiColorChartBand": "#243147",
357-
"euiColorGhost": "#FFFFFF",
358-
"euiColorInk": "#000000",
359357
"euiColorPrimary": "#61A2FF",
360358
"euiColorAccent": "#EE72A6",
361359
"euiColorAccentSecondary": "#16C5C0",
@@ -397,6 +395,8 @@
397395
"euiColorTextSubdued": "#98A8C3",
398396
"euiColorTextDisabled": "#6A7FA0",
399397
"euiColorTextInverse": "#07101F",
398+
"euiColorTextGhost": "#FFFFFF",
399+
"euiColorTextInk": "#07101F",
400400
"euiColorBackgroundBasePrimary": "#0A2342",
401401
"euiColorBackgroundBaseAccent": "#351725",
402402
"euiColorBackgroundBaseAccentSecondary": "#03282B",

packages/eui-theme-borealis/src/eui_theme_borealis_dark.json.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,6 @@ declare module '@elastic/eui-theme-borealis/lib/eui_theme_borealis_dark.json' {
355355
euiColorSeverityDanger: string;
356356
euiColorChartLines: string;
357357
euiColorChartBand: string;
358-
euiColorGhost: string;
359-
euiColorInk: string;
360358
euiColorPrimary: string;
361359
euiColorAccent: string;
362360
euiColorAccentSecondary: string;
@@ -398,6 +396,8 @@ declare module '@elastic/eui-theme-borealis/lib/eui_theme_borealis_dark.json' {
398396
euiColorTextSubdued: string;
399397
euiColorTextDisabled: string;
400398
euiColorTextInverse: string;
399+
euiColorTextGhost: string;
400+
euiColorTextInk: string;
401401
euiColorBackgroundBasePrimary: string;
402402
euiColorBackgroundBaseAccent: string;
403403
euiColorBackgroundBaseAccentSecondary: string;

packages/eui-theme-borealis/src/eui_theme_borealis_light.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,6 @@
354354
"euiColorSeverityDanger": "#EE4C48",
355355
"euiColorChartLines": "#CAD3E2",
356356
"euiColorChartBand": "#F6F9FC",
357-
"euiColorGhost": "#FFFFFF",
358-
"euiColorInk": "#000000",
359357
"euiColorPrimary": "#0B64DD",
360358
"euiColorAccent": "#BC1E70",
361359
"euiColorAccentSecondary": "#008B87",
@@ -397,6 +395,8 @@
397395
"euiColorTextSubdued": "#516381",
398396
"euiColorTextDisabled": "#798EAF",
399397
"euiColorTextInverse": "#FFFFFF",
398+
"euiColorTextGhost": "#FFFFFF",
399+
"euiColorTextInk": "#07101F",
400400
"euiColorBackgroundBasePrimary": "#E8F1FF",
401401
"euiColorBackgroundBaseAccent": "#FFEBF5",
402402
"euiColorBackgroundBaseAccentSecondary": "#E2F9F7",

packages/eui-theme-borealis/src/eui_theme_borealis_light.json.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,6 @@ declare module '@elastic/eui-theme-borealis/lib/eui_theme_borealis_light.json' {
355355
euiColorSeverityDanger: string;
356356
euiColorChartLines: string;
357357
euiColorChartBand: string;
358-
euiColorGhost: string;
359-
euiColorInk: string;
360358
euiColorPrimary: string;
361359
euiColorAccent: string;
362360
euiColorAccentSecondary: string;
@@ -398,6 +396,8 @@ declare module '@elastic/eui-theme-borealis/lib/eui_theme_borealis_light.json' {
398396
euiColorTextSubdued: string;
399397
euiColorTextDisabled: string;
400398
euiColorTextInverse: string;
399+
euiColorTextGhost: string;
400+
euiColorTextInk: string;
401401
euiColorBackgroundBasePrimary: string;
402402
euiColorBackgroundBaseAccent: string;
403403
euiColorBackgroundBaseAccentSecondary: string;

packages/eui-theme-borealis/src/variables/_buttons.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $euiButtonTypes: (
1111
warning: $euiColorBackgroundFilledWarning,
1212
risk: $euiColorBackgroundFilledRisk,
1313
danger: $euiColorBackgroundFilledDanger,
14-
ghost: $euiColorGhost, // Ghost is special, and does not care about theming.
14+
ghost: $euiColorPlainLight, // Ghost is color-mode-invariant
1515
text: $euiColorBackgroundFilledText, // Reserved for special use cases
1616
) !default;
1717

packages/eui-theme-borealis/src/variables/_overrides.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,15 @@ import { severityColorsLightHighContrast } from './colors/_colors_severity_hcm';
1515
export const overrides: _EuiThemeOverrides = {
1616
HCM: {
1717
colors: {
18-
ink: PRIMITIVE_COLORS.black,
19-
ghost: PRIMITIVE_COLORS.white,
18+
plainDark: PRIMITIVE_COLORS.black,
19+
plainLight: PRIMITIVE_COLORS.white,
20+
DARK: {
21+
textInk: PRIMITIVE_COLORS.black,
22+
textGhost: PRIMITIVE_COLORS.white,
23+
},
2024
LIGHT: {
25+
textInk: PRIMITIVE_COLORS.black,
26+
textGhost: PRIMITIVE_COLORS.white,
2127
vis: visColorsLightHighContrast,
2228
severity: severityColorsLightHighContrast,
2329
},

packages/eui-theme-borealis/src/variables/_shadows_dark.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Shadows
2-
$euiShadowColor: $euiColorInk !default;
2+
$euiShadowColor: $euiColorPlainDark !default;
33

44
$euiShadowDownXS: 0 1px 4px 0 hsla(from $euiShadowColor h s l / 0.4), 0 2px 8px 0 hsla(from $euiShadowColor h s l / 0.24);
55
$euiShadowDownS: 0 2px 7px 0 hsla(from $euiShadowColor h s l / 0.46), 0 4px 11px 0 hsla(from $euiShadowColor h s l / 0.26);

packages/eui-theme-borealis/src/variables/colors/_colors_dark.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55

66
@import 'semantic_colors';
77

8-
// Constants (legacy)
9-
$euiColorGhost: $euiColorWhite !default;
10-
$euiColorInk: $euiColorBlack !default;
11-
128
// Brand
139
$euiColorPrimary: $euiColorPrimary60 !default;
1410
$euiColorAccent: $euiColorAccent60 !default;

packages/eui-theme-borealis/src/variables/colors/_colors_dark.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ export const dark_text_colors: _EuiThemeTextColors = {
6666
textSubdued: SEMANTIC_COLORS.shade55,
6767
textDisabled: SEMANTIC_COLORS.shade80,
6868
textInverse: SEMANTIC_COLORS.plainDark,
69+
textInk: SEMANTIC_COLORS.plainDark,
70+
textGhost: SEMANTIC_COLORS.plainLight,
6971
};
7072

7173
export const dark_shades: _EuiThemeShadeColors = {

0 commit comments

Comments
 (0)