Skip to content

Conversation

@mgadewoll
Copy link
Contributor

@mgadewoll mgadewoll commented Mar 24, 2025

Summary

We recently introduced a styling updated on EuiTableRow that makes use of the "previous sibling" selector :has(+ ) (original code here, merged here)

See screenshots of the style here
before after
Screenshot 2025-03-24 at 20 30 05 Screenshot 2025-03-24 at 20 29 53

This selector will currently break tests in CloudUI as their current jsdom version (20.0.0) does not support the newer CSS syntax yet (EUI updated to a fixed resolution version of 24.1.0 here)

This PR adds a small util for checking if the CSS syntax to is supported.

By adding the wrapper we ensure that:

  • we can use the styling on our side
  • we don't break test environments

Changes

  • adds cssSupportsSelector and cssSupportsHasWithNextSibling utils
  • updates EuiTableRow styles to use the util

ℹ️ This issue was also previously marked here in form.styles.

QA

  • verify the styling is applied :
    • toggle isExpandedRow to see the border-radius adjustments for EuiTableRow here
    • (optional) verify styles are applied locally (e.g. by adding additional styles

ℹ️ I verified locally with local EUI packages that this change ensures the tests on CloudUI run as expected.

Screenshot 2025-03-24 at 20 34 05

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)

- this ensures that test environments that don't support the :has(+ ) syntax don't break
@mgadewoll mgadewoll self-assigned this Mar 24, 2025
* Side Public License, v 1.
*/

export const cssSupportsSelector = (selector: string, value: string) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ These utils are not exported on purpose from the main package as they are internal helpers.

@kibanamachine
Copy link

Preview staging links for this PR:

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

cc @mgadewoll

@mgadewoll mgadewoll marked this pull request as ready for review March 25, 2025 14:37
@mgadewoll mgadewoll requested a review from a team as a code owner March 25, 2025 14:37
@tkajtoch tkajtoch self-requested a review March 25, 2025 14:37
Copy link
Member

@tkajtoch tkajtoch left a comment

Choose a reason for hiding this comment

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

The changes look great, LGTM

@mgadewoll mgadewoll merged commit 6ba79ff into elastic:main Mar 25, 2025
6 checks passed
mgadewoll added a commit to elastic/kibana that referenced this pull request Apr 3, 2025
>[!IMPORtANT]
This PR is the direct, manual backport to `8.x` for [this
PR](#215698) that's being merged
to `main`.
The reason it's handled manually is that `8.x` receives a custom EUI
release that still has the "Amsterdam" theme as default theme enabled.

---

`100.0.0` ⏩ `101.1.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.1.0`](https://github.com/elastic/eui/releases/v101.1.0)

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

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

- Updated `EuiProvider` and `EuiThemeProvider` with a new
`highContrastMode` ([#8444](elastic/eui#8444))
- This prop allows toggling a higher contrast visual style that
primarily affects borders and shadows
- On `EuiProvider`, if the `highContrastMode` prop is not passed, this
setting will inherit from the user's OS/system settings
- If the user is using a forced colors mode (e.g. Windows' high contrast
themes), this system setting will take precedence over any
`highContrastMode` or `colorMode` props passed
- Added `highContrastModeStyles` and `preventForcedColors` styling utils
([#8444](elastic/eui#8444))
- Updated `EuiRangeTooltip` to be easier to see in dark mode
([#8444](elastic/eui#8444))
- Updated some deprecated color token usages that have direct
substitutes ([#8444](elastic/eui#8444))
  - `text` -> `textParagraph`
  - `title` -> `textHeading`
  - `subduedText` -> `textSubdued`
  - `disabledText` -> `textDisabled`
  - `accentText` -> `textAccent`
  - `dangerText` -> `textDanger`
  - `warningText` -> `textWarning`
- `useEuiShadow()` now accepts a second `options` argument
([#8234](elastic/eui#8234))
- `useEuiShadowFlat()` now accepts an `options` object instead of only a
color ([#8234](elastic/eui#8234))
- Updated `EuiPopover` and `EuiToolTip` to be easier to see in dark
mode. ([#8174](elastic/eui#8174))

**Bug fixes**

- Fixed a visual bug where a transparent border would create visible
empty space (`LIGHT` mode only) for the components:
([#8427](elastic/eui#8427))
  - `EuiPanel`
  - `EuiPopover`
  - `EuiToolTip`
  - `EuiToast`
  - `EuiTour`
  
  --- 
  
### `@elastic/eui-theme-common`
[`v0.1.0`](https://github.com/elastic/eui/releases/v0.1.0)

- Removed type `EuiShadowCustomColor`
([#8444](elastic/eui#8444))
- Added types:  ([#8444](elastic/eui#8444))
  - `EuiShadowOptions`
  - `EuiThemeHighContrastModeProp`
  - `EuiThemeHighContrastMode`
- Updated shadow utils to accepts a second `options` argument and return
borders in high contrast mode:
([#8444](elastic/eui#8444))
  - `euiShadow`
  - `euiShadowXSmall`
  - `euiShadowSmall`
  - `euiShadowMedium`
  - `euiShadowLarge`
  - `euiSlightShadowHover`
  - `euiShadowFlat`
  
  ---
  
### `@elastic/eui-theme-borealis`
[`v0.1.0`](https://github.com/elastic/eui/releases/v0.1.0)

- Added new component level tokens:
([#8444](elastic/eui#8444))
  - `buttonGroupBackgroundDisabledSelected`
  - `overlayMaskBackground`
  - `overlayMaskBackgroundHighContrast`
  - `skeletonBackgroundSkeletonMiddleHighContrast`
  

## Additional changes

The latest `@elastic/eui` package introduces high contrast mode support.
This PR sets the root `EuiProvider` to use `highContrastMode={false}` to
introduce it in disabled state (this reflects the current functionality
in Kibana).
Cloud-UI can enable this whenever it's tested and supported from their
end.

## QA

Adding high contrast mode in disabled state should result in no visual
changes to the UI.
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