[Colors] Create text-ink and text-ghost tokens#9379
[Colors] Create text-ink and text-ghost tokens#9379weronikaolejniczak merged 18 commits intoelastic:mainfrom
Conversation
|
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:
|
b717dce to
201069a
Compare
packages/website/docs/getting-started/theming/tokens/colors/special_colors_preview.tsx
Outdated
Show resolved
Hide resolved
df1d2d9 to
75f0774
Compare
| color: ${euiTheme.colors.disabledText}; | ||
| background-color: ${euiTheme.colors.disabled}; |
There was a problem hiding this comment.
context:
This is not a 1:1 replacement. textInk and textGhost are meant to be used solely with texts and icons (as indicated by the text prefix), so it only makes sense to keep them grouped with the text colors (which is also how they’re organized in Figma), even if they are color-mode-independent. Using them here (or the constants plainDark / plainLight) would be confusing given the current topology.
This means we need to use other “special colors” here. disabledText and disabled work well enough.
75f0774 to
0355974
Compare
0355974 to
cd864e2
Compare
476c4e7 to
2f9edd1
Compare
packages/eui-theme-common/src/global_styling/variables/_buttons.scss
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Thank you! Looks good to me, and I also wanted to tag @JoseLuisGJ for awareness
| "euiColorChartLines": "#7186A8", | ||
| "euiColorChartBand": "#243147", | ||
| "euiColorGhost": "#FFFFFF", | ||
| "euiColorInk": "#000000", |
There was a problem hiding this comment.
Blocking: We'll need to add the new tokens textInk and textGhost as JSON tokens euiColorTextInk and euiColorTextGhost since we still support the usage of those.
If I see it correctly, then these should use the text JSON tokens?
There was a problem hiding this comment.
I treated the JSON in a similar way like Sass but you are absolutely right we should add them here. I will go through the Kibana usage again and correct as needed.
There was a problem hiding this comment.
Just as additional context: JSON tokens used to be mapped from Sass and the original intention was to remove them as well but while rolling out Borealis we noticed that we need to support them for static use cases where the react theme is not available 🫠
There was a problem hiding this comment.
packages/website/docs/getting-started/theming/tokens/colors/special_colors_preview.tsx
Outdated
Show resolved
Hide resolved
|
@mgadewoll thank you for the review, I addressed your feedback 😄 |
packages/website/docs/getting-started/theming/tokens/colors/special_colors_preview.tsx
Outdated
Show resolved
Hide resolved
packages/website/docs/getting-started/theming/tokens/colors/special_colors_preview.tsx
Outdated
Show resolved
Hide resolved
💚 Build SucceededHistory
|
💚 Build Succeeded
History
|
mgadewoll
left a comment
There was a problem hiding this comment.
🟢 Thanks for the additional updates! All changes are LGTM and look/work as expected. Nice work! 🎉
| @@ -0,0 +1,5 @@ | |||
| - Added `textInk` and `textGhost` color tokens for text and icon colors that should always remain dark or light regardless of color mode. | |||
There was a problem hiding this comment.
ℹ️ I just realized that this PR had the skip-changelog-eui label. I missed that in the review 🫠
We should add a changelog for this on eui as well as the tokens are consumed through the theme from eui.
I added a PR for it here.
## Dependency updates - `@elastic/eui` - v112.3.0 ⏩ v113.0.0 - `@elastic/eui-theme-borealis` - v5.4.0 ⏩ v6.0.0 - `@elastic/eslint-plugin-eui` - v2.8.0 ⏩ v2.9.0 --- ## Changes 1. EUI component update: API and Design updates to form layout append/prepend by using the new components `EuiFormPrepend` and `EuiFormAppend` (EUI [#9308](elastic/eui#9308)) >[!important] ❗ This upgrade PR includes all changes previously made in the specific QA PR #248805. Please see the description in that PR for detailed information about the specific changes. 2. Additional changes related to the form layout changes >[!note] 🔗 Please see the [section "Additional changes"](#248805 (comment)) in #248805 for an overview of additional changes. 3. Removed token update: Replaced `ghost` and `ink` token usages with `textInk` or `plainDark` and `textGhost` or `plainLight` respectively (EUI [#9379](elastic/eui#9379)) ## Package updates ### `@elastic/eui` [v113.0.0](https://github.com/elastic/eui/releases/tag/v113.0.0) - Updated `EuiFlyout` manager to close all flyouts when a parent flyout is closed. ([#9378](elastic/eui#9378)) - Added `textInk` and `textGhost` color tokens for text and icon colors that should always remain dark or light regardless of color mode. ([#9379](elastic/eui#9379)) - Added `EuiFormAppend` and `EuiFormPrepend` components ([#9014](elastic/eui#9014)) - Added support for `type="span"` on `EuiFormLabel` for visual-only form labels ([#9014](elastic/eui#9014)) - Updated `EuiFormLabel` to render a `span` if no `htmlFor` is passed ([#9014](elastic/eui#9014)) - Updated `EuiFormControlLayout` to use `EuiFormAppend` and `EuiFormPrepend` ([#9014](elastic/eui#9014)) - Updated `EuiAutoRefresh` and `EuiColorPicker` to use `EuiFormPrepend` ([#9014](elastic/eui#9014)) - Updated `EuiFormAppend`/`EuiFormPrepend` styling ([#9305](elastic/eui#9305)) - Updated `EuiFormAppend`/`EuiFormPrepend` to inherit `isDisabled` state from `EuiFormControlLayout` ([#9305](elastic/eui#9305)) - Updated `EuiFormControlLayout` hover, disabled and readonly styling ([#9305](elastic/eui#9305)) - Updated `EuiFormControlButton` to inherit `isDisabled`, `readOnly` and `isInvalid` states from `EuiFormControlLayout` ([#9305](elastic/eui#9305)) - Added `iconSide` prop on `EuiDatePickerRange` ([#9305](elastic/eui#9305)) - Updated `EuiSuperDatePicker` valid state styling ([#9305](elastic/eui#9305)) - Removed background color transition on `EuiButtonEmpty` (other button variants don't have a transition anymore either) ([#9305](elastic/eui#9305)) - Added `isLoading` prop on `EuiFormControlButton` ([#9328](elastic/eui#9328)) - Updated paddings for `EuiButton`, `EuiButtonEmpty`, `EuiFilterButton` ([#8948](elastic/eui#8948)) - Updated paddings for `append`/`prepend` on `EuiFormControlLayout` ([#8948](elastic/eui#8948)) - Added optional `scrollContainerRef` prop to `EuiFlyoutBody` for accessing the flyout's internal scroll container. ([#9373](elastic/eui#9373)) **Bug fixes** - Updated `EuiColorPicker` to ensure `id` is correctly passed onto the internal `EuiFormControlLayout` ([#9014](elastic/eui#9014)) **Breaking changes** - Removed `ink` and `ghost` theme tokens. Use `textInk` / `textGhost` for text and icon colors or `plainDark` /`plainLight` for non-text use cases. ([#9379](elastic/eui#9379)) - Updated `EuiQuickSelectPopover` in `EuiSuperDatePicker` to use `EuiFormPrepend`. This results in more restricted `buttonProps` as they reflect `EuiFormPrepend` instead of generic `EuiButtonEmpty` props. ([#9014](elastic/eui#9014)) - Removed `components.superDatePickerBackgroundSuccees` token ([#9305](elastic/eui#9305)) ### `@elastic/eui-theme-borealis` v6.0.0 - Added `textInk` and `textGhost` color tokens for text and icon colors that should always remain dark or light regardless of color mode. ([#9379](elastic/eui#9379)) ### `@elastic/eslint-plugin-eui` v2.9.0 - Prevented `badge-accessibility-rules` rule autofix from duplicating `aria-hidden` attributes. ([#9366](elastic/eui#9366)) - Skip `badge-accessibility-rules` rule validation when a spread operator is used in a component. ([#9366](elastic/eui#9366)) --------- Co-authored-by: Weronika Olejniczak <weronika.olejniczak@elastic.co> Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>




Summary
textInkandtextGhostcolor tokens.inkandghostcolor tokens andeuiColorInkandeuiColorGhostSass variables.inkandghostwithtextInkandtextGhostfor text and icon color, otherwiseplainDarkandplainLight.Why are we making this change?
Resolves #8968
inkandghostcolor tokens are Amsterdam remnants. We want to remove them in favor of:textInkandtextGhostcolor tokens used specifically for text and icon color,plainDarkandplainLightin all other cases.Screenshots # (WIP)
There are no visual changes. No regression. Verified with VRT.
Impact to users
🔴 This is a breaking change. Even though the usage on consumer side is minimal.
Kibana
Usages:
Update commit: elastic/kibana@b17eb9e
Cloud UI
Usages:
Update commit: https://github.com/weronikaolejniczak/cloud-ui/commit/6e111016ae9fc2b830aa0438daab7d24454bc733
QA
Specific checklist
textInkandtextGhostare available andinkandghostare notyarn workspace @elastic/eui test-visual-regressionGeneral checklist
and Windowshigh contrast modesEdge, and Firefox@defaultif default values are missing) and playground toggles