Skip to content

Conversation

@mgadewoll
Copy link
Contributor

@mgadewoll mgadewoll commented Mar 24, 2025

Summary

This PR adds a couple style adjustments after merging #8444 to introduce high contrast mode.

Changes

  • fixes the high contrast border style for EuiSelectableTemplateSidewide inside of EuiHeader when the header is using theme="dark"
    • we currently can't use the default border token here, as the header is not using a EuiThemeProvider context to set a dark colorMode instead it's using a light colorMode with custom dark styling. To ensure expected high contrast borders we need to use a static token.
before after
Screenshot 2025-03-24 at 16 56 42 Screenshot 2025-03-24 at 16 56 58
  • adds a border for EuiCode in forced high contrast mode to add better visual distinction
before after
Screenshot 2025-03-24 at 16 22 31 Screenshot 2025-03-24 at 16 22 10
  • updates the opacity styling for code punctuation to ensure higher color contrast
before after
Screenshot 2025-03-24 at 16 43 54 Screenshot 2025-03-24 at 16 43 49
  • updates button text colors for high contrast mode (specifically the snowflake color for warning variants
before after
Screenshot 2025-03-25 at 12 27 39 Screenshot 2025-03-25 at 12 27 43
Screenshot 2025-03-25 at 12 27 47 Screenshot 2025-03-25 at 12 27 50
  • updates badge component styles to apply borders for lighter default color variants (affects EuiBadge, EuiBetaBadge and EuiNotificationBadge)
before after
Screenshot 2025-03-25 at 11 38 57 Screenshot 2025-03-25 at 11 36 59
Screenshot 2025-03-25 at 11 38 51 Screenshot 2025-03-25 at 11 37 05
Screenshot 2025-03-25 at 12 02 08 Screenshot 2025-03-25 at 12 02 13
Screenshot 2025-03-25 at 12 02 34 Screenshot 2025-03-25 at 12 02 27

QA

  • verify the search in EuiHeader has proper high contrast mode styles
  • verify EuiCode has a border in forced-colors high contrast mode and punctuation styles do not have opacity
  • verify light background color variants (default, subdued, hollow, disabled) of EuiBadge, EuiBetaBadge and EuiNotificationBadge have borders applied in high contrast mode

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)

- the regular border token does not work as the header is not in a dark colorMode but actually light colorMode with dark styling
- ensures min. color contrast for punctuation styles

- adds a border for forced color high contrast mode to add a visible distinction
@mgadewoll mgadewoll self-assigned this Mar 24, 2025
@mgadewoll mgadewoll marked this pull request as ready for review March 24, 2025 16:55
@mgadewoll mgadewoll requested a review from a team as a code owner March 24, 2025 16:55
@weronikaolejniczak weronikaolejniczak self-requested a review March 25, 2025 10:19
@mgadewoll mgadewoll marked this pull request as draft March 25, 2025 10:20
Copy link
Contributor

@weronikaolejniczak weronikaolejniczak left a comment

Choose a reason for hiding this comment

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

LGTM! 🎉 Great work on the high contrast mode, Lene!

- this applies specifically for warning variants currently that have a special text color
- ensures better visual distinction on lighter badges as well as proper text contrast for warning badges
@mgadewoll mgadewoll changed the title [HCM] Small styles adjustments [HCM] Component styles adjustments #1 Mar 25, 2025
@mgadewoll mgadewoll marked this pull request as ready for review March 25, 2025 11:40
@weronikaolejniczak weronikaolejniczak self-requested a review March 25, 2025 16:43
@kibanamachine
Copy link

Preview staging links for this PR:

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @mgadewoll

Copy link
Contributor

@weronikaolejniczak weronikaolejniczak left a comment

Choose a reason for hiding this comment

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

I tested in Storybook, LGTM 👍🏻

@mgadewoll mgadewoll merged commit 4ced53d into elastic:main Mar 26, 2025
5 checks passed
@JasonStoltz JasonStoltz mentioned this pull request Apr 8, 2025
2 tasks
weronikaolejniczak added a commit to elastic/kibana that referenced this pull request Apr 10, 2025
> [!Note]
> This PR is a manual backport of the already merged
#217491

`101.0.1` ⏩ `101.3.0-classic.0`

[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)

## Package updates

### `@elastic/eui`

#### [`v101.3.0`](https://github.com/elastic/eui/releases/v101.3.0)

- Updated 78 existing and added two new glyphs (`code` and
`checkCircle`) for `EuiIcon`
([#8530](elastic/eui#8530))
- Changed `gutterSize` to `m` between right side items on
`EuiPageHeader` ([#8529](elastic/eui#8529))

**Bug fixes**

- Fixed a visual bug on disabled `EuiButton` in high contrast mode where
wrong text colors were applied
([#8550](elastic/eui#8550))

#### [`v101.2.0`](https://github.com/elastic/eui/releases/v101.2.0)

- Added `showToolTip` prop on `EuiColorPickerSwatch`
([#8512](elastic/eui#8512))

**Bug fixes**

- Fixed a visual issue of overlapping borders for layered `EuiPanel`s
([#8519](elastic/eui#8519))
- Fixes wrong `colorMode` styling for the search in `EuiHeader` with
`theme="dark"` ([#8496](elastic/eui#8496))

**Accessibility**

- Improved the accessibility of `EuiColorPicker` by adding color label
tooltips on hover and focus for color swatches
([#8512](elastic/eui#8512))
- Added `disableScreenReaderOutput` prop on `EuiToolTip` to manually
control if the tooltip content should be read when focusing the trigger.
This prevents duplicate screen reader output when the tooltip content
and `aria-label` on the trigger element have the same text content.
([#8508](elastic/eui#8508))
- Improves text color contrast for `EuiButton` with `color="warning"` in
high contrast mode ([#8496](elastic/eui#8496))
- Improves contrast and visible distinction of the following components
in high contrast mode:
([#8496](elastic/eui#8496))
  - `EuiCode`
  - `EuiBadge`
  - `EuiBetaBadge`
  - `EuiNotificationBadge`

**Dependency updates**

- Updated `prismjs` to v1.30.0
([#8506](elastic/eui#8506))

#### [`v101.1.0`](https://github.com/elastic/eui/releases/v101.1.0)

- Updates `EuiTableRow` styles to check support for `:has(+)` selector
([#8498](elastic/eui#8498))


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

---------

Co-authored-by: Weronika Olejniczak <weronika.olejniczak@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants