-
Notifications
You must be signed in to change notification settings - Fork 861
[HCM] Add high contrast mode overrides for data visualization and severity color tokens #8800
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
mgadewoll
merged 14 commits into
elastic:main
from
mgadewoll:hcm/8632-add-hcm-data-vis-colors
Jul 7, 2025
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0904566
refactor: enable color mode separated dataVis and severity colors
mgadewoll 78ca341
feat: enable hcm overrides for data vis and severity colors
mgadewoll 70b3c86
docs(storybook): update palettes examples
mgadewoll 167ae69
test: add unit test
mgadewoll 390bf0b
chore: add deprecation marker
mgadewoll 5715ffc
docs: update docs
mgadewoll 50a4109
test(vrt): update deferenace images
mgadewoll ae817a5
test(vrt): update deferenace images
mgadewoll 0242dbe
chore: add changelogs
mgadewoll 5182cae
refactor: update hcm tokens after rebase
mgadewoll 442f49d
chore: update changelog
mgadewoll 416da52
docs(storybook): add separate stories for darkmode and high contrast …
mgadewoll 7eaca55
test(vrt): add/update reference images
mgadewoll 8f5615a
chore: cleanup this no-verify
mgadewoll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| - Added high contrast mode specific color values for `colors.vis` and `colors.severity` tokens in light color mode | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
packages/eui-theme-borealis/src/variables/colors/_colors_severity_hcm.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| import { SEMANTIC_COLORS } from './_semantic_colors'; | ||
|
|
||
| export const severityColorsLightHighContrast = { | ||
| unknown: SEMANTIC_COLORS.shade70, | ||
| neutral: SEMANTIC_COLORS.neutral70, | ||
| success: SEMANTIC_COLORS.success80, | ||
| warning: SEMANTIC_COLORS.warning80, | ||
| risk: SEMANTIC_COLORS.risk70, | ||
| danger: SEMANTIC_COLORS.danger70, | ||
| }; |
80 changes: 80 additions & 0 deletions
80
packages/eui-theme-borealis/src/variables/colors/_colors_vis_hcm.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License | ||
| * 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
| * in compliance with, at your election, the Elastic License 2.0 or the Server | ||
| * Side Public License, v 1. | ||
| */ | ||
|
|
||
| import { _EuiThemeVisColors } from '@elastic/eui-theme-common'; | ||
|
|
||
| import { SEMANTIC_COLORS } from './_semantic_colors'; | ||
| import { PRIMITIVE_COLORS } from './_primitive_colors'; | ||
|
|
||
| const baseColorVis = { | ||
| euiColorVis0: SEMANTIC_COLORS.accentSecondary110, | ||
| euiColorVis1: SEMANTIC_COLORS.accentSecondary80, | ||
| euiColorVis2: SEMANTIC_COLORS.primary110, | ||
| euiColorVis3: SEMANTIC_COLORS.primary80, | ||
| euiColorVis4: SEMANTIC_COLORS.accent110, | ||
| euiColorVis5: SEMANTIC_COLORS.accent80, | ||
| euiColorVis6: SEMANTIC_COLORS.danger110, | ||
| euiColorVis7: SEMANTIC_COLORS.danger80, | ||
| euiColorVis8: SEMANTIC_COLORS.warning110, | ||
| euiColorVis9: SEMANTIC_COLORS.warning80, | ||
| }; | ||
|
|
||
| export const visColorsLightHighContrast: _EuiThemeVisColors = { | ||
| ...baseColorVis, | ||
|
|
||
| euiColorVisBehindText0: baseColorVis.euiColorVis0, | ||
| euiColorVisBehindText1: baseColorVis.euiColorVis1, | ||
| euiColorVisBehindText2: baseColorVis.euiColorVis2, | ||
| euiColorVisBehindText3: baseColorVis.euiColorVis3, | ||
| euiColorVisBehindText4: baseColorVis.euiColorVis4, | ||
| euiColorVisBehindText5: baseColorVis.euiColorVis5, | ||
| euiColorVisBehindText6: baseColorVis.euiColorVis6, | ||
| euiColorVisBehindText7: baseColorVis.euiColorVis7, | ||
| euiColorVisBehindText8: baseColorVis.euiColorVis8, | ||
| euiColorVisBehindText9: baseColorVis.euiColorVis9, | ||
|
|
||
| euiColorVisText0: SEMANTIC_COLORS.accentSecondary110, | ||
| euiColorVisText1: SEMANTIC_COLORS.accentSecondary100, | ||
| euiColorVisText2: SEMANTIC_COLORS.primary110, | ||
| euiColorVisText3: SEMANTIC_COLORS.primary90, | ||
| euiColorVisText4: SEMANTIC_COLORS.accent100, | ||
| euiColorVisText5: SEMANTIC_COLORS.accent80, | ||
| euiColorVisText6: SEMANTIC_COLORS.danger100, | ||
| euiColorVisText7: SEMANTIC_COLORS.danger80, | ||
| euiColorVisText8: SEMANTIC_COLORS.warning110, | ||
| euiColorVisText9: SEMANTIC_COLORS.warning90, | ||
|
|
||
| euiColorVisNeutral0: SEMANTIC_COLORS.neutral100, | ||
| euiColorVisNeutral1: SEMANTIC_COLORS.neutral80, | ||
| euiColorVisSuccess0: SEMANTIC_COLORS.success100, | ||
| euiColorVisSuccess1: SEMANTIC_COLORS.success80, | ||
| euiColorVisWarning0: SEMANTIC_COLORS.warning100, | ||
| euiColorVisWarning1: SEMANTIC_COLORS.warning80, | ||
| euiColorVisRisk0: SEMANTIC_COLORS.risk100, | ||
| euiColorVisRisk1: SEMANTIC_COLORS.risk80, | ||
| euiColorVisDanger0: SEMANTIC_COLORS.danger100, | ||
| euiColorVisDanger1: SEMANTIC_COLORS.danger80, | ||
|
|
||
| euiColorVisBase0: PRIMITIVE_COLORS.mutedGrey10, | ||
|
|
||
| euiColorVisGrey0: PRIMITIVE_COLORS.blueGrey30, | ||
| euiColorVisGrey1: PRIMITIVE_COLORS.blueGrey60, | ||
| euiColorVisGrey2: PRIMITIVE_COLORS.blueGrey90, | ||
| euiColorVisGrey3: PRIMITIVE_COLORS.blueGrey130, | ||
|
|
||
| euiColorVisWarm0: SEMANTIC_COLORS.danger10, | ||
| euiColorVisWarm1: SEMANTIC_COLORS.danger50, | ||
| euiColorVisWarm2: SEMANTIC_COLORS.danger100, | ||
|
|
||
| euiColorVisCool0: SEMANTIC_COLORS.primary10, | ||
| euiColorVisCool1: SEMANTIC_COLORS.primary50, | ||
| euiColorVisCool2: SEMANTIC_COLORS.primary100, | ||
|
|
||
| euiColorVisComplementary0: SEMANTIC_COLORS.primary80, | ||
| euiColorVisComplementary1: SEMANTIC_COLORS.warning80, | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| **Breaking changes** | ||
|
|
||
| - Updated `_EuiThemeColors` type to include `_EuiThemeVisColors` and `_EuiThemeSeverityColors` as `StrictColorModeSwitch` instead of static colors. This requires `vis` and `severity` keys to be defined as part of `LIGHT` and `DARK` color mode objects. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-51 Bytes
(100%)
...ki/reference/chrome_desktop_Display_EuiComment_EuiCommentList_High_Contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+164 KB
...chrome_desktop_Forms_EuiColorPalettePicker_EuiColorPaletteDisplay_Dark_Mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+153 KB
(2100%)
...me_desktop_Forms_EuiColorPalettePicker_EuiColorPaletteDisplay_High_Contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+150 KB
..._Forms_EuiColorPalettePicker_EuiColorPaletteDisplay_High_Contrast_Dark_Mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+21.3 KB
(110%)
...ome_desktop_Forms_EuiColorPalettePicker_EuiColorPaletteDisplay_Kitchen_Sink.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+53 Bytes
(100%)
.../reference/chrome_desktop_Forms_EuiColorPicker_EuiColorPicker_High_Contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+240 Bytes
(100%)
.../chrome_desktop_Forms_EuiColorPicker_EuiColorPicker_High_Contrast_Dark_Mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-5 Bytes
(100%)
...ages/eui/.loki/reference/chrome_desktop_Forms_EuiFilterButton_High_Contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-10 Bytes
(100%)
...ference/chrome_desktop_Navigation_EuiKeyPadMenu_EuiKeyPadMenu_High_Contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+11 Bytes
(100%)
...ference/chrome_desktop_Navigation_EuiSteps_EuiStepsHorizontal_High_Contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+1 Byte
(100%)
...i/.loki/reference/chrome_desktop_Navigation_EuiSteps_EuiSteps_High_Contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-250 Bytes
(100%)
...oki/reference/chrome_mobile_Display_EuiComment_EuiCommentList_High_Contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-23.9 KB
(75%)
...ages/eui/.loki/reference/chrome_mobile_Display_EuiEmptyPrompt_Page_Template.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+209 KB
.../chrome_mobile_Forms_EuiColorPalettePicker_EuiColorPaletteDisplay_Dark_Mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+195 KB
(2200%)
...ome_mobile_Forms_EuiColorPalettePicker_EuiColorPaletteDisplay_High_Contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+192 KB
..._Forms_EuiColorPalettePicker_EuiColorPaletteDisplay_High_Contrast_Dark_Mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+38.7 KB
(120%)
...rome_mobile_Forms_EuiColorPalettePicker_EuiColorPaletteDisplay_Kitchen_Sink.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-10 Bytes
(100%)
...i/reference/chrome_mobile_Forms_EuiColorPicker_EuiColorPicker_High_Contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+380 Bytes
(100%)
...e/chrome_mobile_Forms_EuiColorPicker_EuiColorPicker_High_Contrast_Dark_Mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+9 Bytes
(100%)
packages/eui/.loki/reference/chrome_mobile_Forms_EuiFilterButton_High_Contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-19 Bytes
(100%)
...eference/chrome_mobile_Navigation_EuiKeyPadMenu_EuiKeyPadMenu_High_Contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+19 Bytes
(100%)
...eference/chrome_mobile_Navigation_EuiSteps_EuiStepsHorizontal_High_Contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+32 Bytes
(100%)
...ui/.loki/reference/chrome_mobile_Navigation_EuiSteps_EuiSteps_High_Contrast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| - Added high contrast mode specific color values for `colors.vis` and `colors.severity` tokens in light color mode | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.