Skip to content

Conversation

@mgadewoll
Copy link
Contributor

@mgadewoll mgadewoll commented Jun 12, 2025

Summary

Closes #8589

Note

It's suggested to review this PR by following along by commit.

This PR updates the theme tokens for data visualization text to ensure there are tokens available to create labels for visualizations that are readable in both color modes.

This PR aligns the previously available text tokens that were named per color mode into a single set of tokens that are connected to the theme color mode. This ensures that the tokens update based on the selected theme color mode.

Changes

  • separates data vis color files into separate color modes (light, dark)
  • combines and renames euiColorVisAsTextDark{NUMBER} and euiColorVisAsTextLight{NUMBER} tokens to euiColorVisText{NUMBER}
  • adds additional text tokens to match the amount of data vis colors (previously only there were only 6 text color tokens, now it's 9)
    • ℹ️ Adds approximations for colors for Amsterdam (there are no specs for those)
  • updates token values for euiColorVisText tokens
    • ℹ️ Updates Amsterdam token color order to align with the new purpose of matching related text token with data vis color tokens
  • updates EUI palette functions euiPaletteForLightBackground and euiPaletteForDarkBackground to use the new tokens
    • deprecates these palette functions as the tokens can be used from the theme directly instead
      • ℹ️ there is currently only a single usage in elastic-charts storybook (code)
  • outputs the new data vis text tokens in the EUI docs

Why are we making this change?

This change ensures that visualizations have tokens available to apply to text which relate directly to the used colors for data visualizations. This solves an accessibility issue when using the available data vis colors would otherwise result in text that is too light on light backgrounds.

Screenshots

theme light dark
Borealis Screenshot 2025-06-12 at 19 00 57 Screenshot 2025-06-12 at 18 58 19
Amsterdam Screenshot 2025-06-13 at 13 52 52 Screenshot 2025-06-13 at 13 42 20

Impact to users

⚠️ This is a breaking change because we're removing these previously available tokens:

euiColorVisAsTextLight1
euiColorVisAsTextLight0
euiColorVisAsTextLight2
euiColorVisAsTextLight3
euiColorVisAsTextLight4
euiColorVisAsTextLight5
euiColorVisAsTextLight6

euiColorVisAsTextDark1
euiColorVisAsTextDark0
euiColorVisAsTextDark2
euiColorVisAsTextDark3
euiColorVisAsTextDark4
euiColorVisAsTextDark5
euiColorVisAsTextDark6

🟢 Those tokens are not in use in Kibana or Cloud-UI. This is mainly due to the tokens having been introduced only recently with the introduction of the Borealis theme. Originally they were solely in use in the euiPaletteForLightBackground and euiPaletteForDarkBackground palettes

Additional notes

🟢 The changes were tested against Kibana and eui-theme/amsterdam.

⚠️ We'll need to update eui-theme/amsterdam on the next release to match the changed colorVis imports.
Changes required here and here:

// current
import { colorVis } from '../../themes/amsterdam/global_styling/variables/_colors_vis';

// update
import { colorVisLight as colorVis } from '../../themes/amsterdam/global_styling/variables/_colors_vis_light';

QA

  • verify the added token values for Borealis match the design specs (issue)

General checklist

  • Browser QA
    • Checked in both light and dark modes
    • Checked in both MacOS and Windows high contrast modes
    • Checked in mobile
    • Checked in Chrome, Safari, Edge, and Firefox
    • Checked for accessibility including keyboard-only and screenreader modes
  • Docs site QA
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately.
    • If applicable, added the breaking change issue label (and filled out the breaking change checklist)
  • Designer checklist
    • If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)

@mgadewoll mgadewoll self-assigned this Jun 12, 2025
@mgadewoll mgadewoll added visual refresh breaking change PRs with breaking changes. (Don't delete - used for automation) labels Jun 12, 2025
@github-actions
Copy link

github-actions bot commented Jun 12, 2025

This PR contains breaking changes. The opener of this pull request is asked to perform the following due diligence steps below, to assist EUI in our next Kibana upgrade:

  • If this PR contains prop/API changes:
    • Search through Kibana for <EuiComponent usages (example search)
    • In the PR description or in a PR comment, include a count or list with the number of component usages in Kibana that will need to be updated (if that amount is "none", include that information as well)
  • If this PR contains CSS changes:
    • Search through Kibana for the changed EUI selectors, e.g. .euiComponent (example search)
    • In the PR description or in a PR comment, include a count or list with the number of custom CSS overrides in Kibana that will need to be updated (if that amount is "none", include that information as well)
  • 🔍 Tip: When searching through Kibana, consider excluding **/target, **/*.snap, **/*.storyshot files to reduce noise and only look at source code usages
  • ⚠️ For extremely risky changes, the EUI team should potentially consider the following precautions:
    • Using a pre-release release candidate to test Kibana CI ahead of time
    • Using kibana-a-la-carte for manual QA, and to give other Kibana teams a staging server to quickly test against

@mgadewoll mgadewoll requested a review from gvnmagni June 12, 2025 17:17
@mgadewoll mgadewoll force-pushed the theme/8589-update-data-vis-text-colors branch from f887dee to ba3c24b Compare June 12, 2025 17:25
@mgadewoll mgadewoll marked this pull request as ready for review June 13, 2025 08:46
@mgadewoll mgadewoll requested a review from a team as a code owner June 13, 2025 08:46
Copy link
Contributor

@acstll acstll left a comment

Choose a reason for hiding this comment

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

Found one small thing in a .scss file, and I have a doubt regarding some Amsterdam values in SCSS/JSON.

Also (not so important), the approximations in Amsterdam in some cases do not match the hue, e.g. text2 and text3 in Borealis are "blue", but in Amsterdam are magenta/purple-ish, is that intentional?

In summary, I checked the token assignments follow the spec ✅, and checked values in SCSS and JSON.

(I felt like I was reviewing again my own PR from yesterday haha 😅)

Copy link
Contributor

@acstll acstll left a comment

Choose a reason for hiding this comment

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

Thanks for the quick update! 🟢

@gvnmagni
Copy link
Contributor

Thank you Lene, the only thing that I would change is that I would put a dedicated table for these tokens at the end of the documentation page, these tokens are almost never used and they are here as a fallback in case of need for text visualisation, I would love to give them less importance and to separate them from default datavis colors

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @mgadewoll

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @mgadewoll

@mgadewoll mgadewoll merged commit a46ac8d into elastic:main Jun 23, 2025
5 checks passed
mgadewoll added a commit to elastic/kibana that referenced this pull request Jun 25, 2025
`103.1.0` ⏩ `104.0.2`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Changes

- updates flat tooltip prop usages on **EuiCopy** to use new
`tooltipProp`

## Package updates

### `@elastic/eui`

## [`v104.0.2`](https://github.com/elastic/eui/releases/v104.0.2)

**Bug fixes**

- Fixed missing JSON token exports for
`euiColorBackgroundBaseInteractiveSelectHover` and
`euiColorBorderStrongText`
([#8819](elastic/eui#8819))

## [`v104.0.1`](https://github.com/elastic/eui/releases/v104.0.1)

**Bug fixes**

- Fixed a wrong path in the module declaration for the JSON token
exports that would trigger typescript errors
([#8818](elastic/eui#8818))

## [`v104.0.0`](https://github.com/elastic/eui/releases/v104.0.0)

- Added data vis text color tokens:
([#8793](elastic/eui#8793))
  - `colors.vis.euiColorVisText0`
  - `colors.vis.euiColorVisText1`
  - `colors.vis.euiColorVisText2`
  - `colors.vis.euiColorVisText3`
  - `colors.vis.euiColorVisText4`
  - `colors.vis.euiColorVisText5`
  - `colors.vis.euiColorVisText6`
  - `colors.vis.euiColorVisText7`
  - `colors.vis.euiColorVisText8`
  - `colors.vis.euiColorVisText9`
- Updated and aligned background hover styles for `EuiTable` and
`EuiDataGrid` ([#8769](elastic/eui#8769))

**Deprecations**

- Deprecated `euiPaletteForLightBackground` and
`euiPaletteForDarkBackground` palettes. Use the newly added data vis
color tokens instead.
([#8793](elastic/eui#8793))

**Breaking changes**

- Removed tokens: ([#8793](elastic/eui#8793))
  - `colors.vis.euiColorVisAsTextLight1`
  - `colors.vis.euiColorVisAsTextLight0`
  - `colors.vis.euiColorVisAsTextLight2`
  - `colors.vis.euiColorVisAsTextLight3`
  - `colors.vis.euiColorVisAsTextLight4`
  - `colors.vis.euiColorVisAsTextLight5`
  - `colors.vis.euiColorVisAsTextLight6`
  - `colors.vis.euiColorVisAsTextDark1`
  - `colors.vis.euiColorVisAsTextDark0`
  - `colors.vis.euiColorVisAsTextDark2`
  - `colors.vis.euiColorVisAsTextDark3`
  - `colors.vis.euiColorVisAsTextDark4`
  - `colors.vis.euiColorVisAsTextDark5`
  - `colors.vis.euiColorVisAsTextDark6`
- Removed `xl` size from `EuiTabs`
([#8762](elastic/eui#8762))
- Added `tooltipProps` to `EuiCopy` which replaces spreading all props
to `EuiToolTip` ([#8758](elastic/eui#8758))

<!--ONMERGE {"backportTargets":["8.19"]} ONMERGE-->

---------

Co-authored-by: Elastic Machine <[email protected]>
mgadewoll added a commit to mgadewoll/kibana that referenced this pull request Jul 14, 2025
`103.1.0` ⏩ `104.0.2`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Changes

- updates flat tooltip prop usages on **EuiCopy** to use new
`tooltipProp`

## Package updates

### `@elastic/eui`

## [`v104.0.2`](https://github.com/elastic/eui/releases/v104.0.2)

**Bug fixes**

- Fixed missing JSON token exports for
`euiColorBackgroundBaseInteractiveSelectHover` and
`euiColorBorderStrongText`
([elastic#8819](elastic/eui#8819))

## [`v104.0.1`](https://github.com/elastic/eui/releases/v104.0.1)

**Bug fixes**

- Fixed a wrong path in the module declaration for the JSON token
exports that would trigger typescript errors
([elastic#8818](elastic/eui#8818))

## [`v104.0.0`](https://github.com/elastic/eui/releases/v104.0.0)

- Added data vis text color tokens:
([elastic#8793](elastic/eui#8793))
  - `colors.vis.euiColorVisText0`
  - `colors.vis.euiColorVisText1`
  - `colors.vis.euiColorVisText2`
  - `colors.vis.euiColorVisText3`
  - `colors.vis.euiColorVisText4`
  - `colors.vis.euiColorVisText5`
  - `colors.vis.euiColorVisText6`
  - `colors.vis.euiColorVisText7`
  - `colors.vis.euiColorVisText8`
  - `colors.vis.euiColorVisText9`
- Updated and aligned background hover styles for `EuiTable` and
`EuiDataGrid` ([elastic#8769](elastic/eui#8769))

**Deprecations**

- Deprecated `euiPaletteForLightBackground` and
`euiPaletteForDarkBackground` palettes. Use the newly added data vis
color tokens instead.
([elastic#8793](elastic/eui#8793))

**Breaking changes**

- Removed tokens: ([elastic#8793](elastic/eui#8793))
  - `colors.vis.euiColorVisAsTextLight1`
  - `colors.vis.euiColorVisAsTextLight0`
  - `colors.vis.euiColorVisAsTextLight2`
  - `colors.vis.euiColorVisAsTextLight3`
  - `colors.vis.euiColorVisAsTextLight4`
  - `colors.vis.euiColorVisAsTextLight5`
  - `colors.vis.euiColorVisAsTextLight6`
  - `colors.vis.euiColorVisAsTextDark1`
  - `colors.vis.euiColorVisAsTextDark0`
  - `colors.vis.euiColorVisAsTextDark2`
  - `colors.vis.euiColorVisAsTextDark3`
  - `colors.vis.euiColorVisAsTextDark4`
  - `colors.vis.euiColorVisAsTextDark5`
  - `colors.vis.euiColorVisAsTextDark6`
- Removed `xl` size from `EuiTabs`
([elastic#8762](elastic/eui#8762))
- Added `tooltipProps` to `EuiCopy` which replaces spreading all props
to `EuiToolTip` ([elastic#8758](elastic/eui#8758))

<!--ONMERGE {"backportTargets":["8.19"]} ONMERGE-->

---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit efedad1)

# Conflicts:
#	package.json
#	src/dev/license_checker/config.ts
#	yarn.lock
@JasonStoltz JasonStoltz mentioned this pull request Sep 15, 2025
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change PRs with breaking changes. (Don't delete - used for automation) visual refresh

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Visual Refresh] Update of euiColorVisAsText to solve accessibility concern

4 participants