Skip to content
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

[EuiSitewideSearch] Increase Color Contrast on Meta Labels to Meet WCAG 4.5 Contrast Ratio #6761

Merged
merged 5 commits into from
May 10, 2023

Conversation

breehall
Copy link
Contributor

@breehall breehall commented May 9, 2023

Fixes #6623

Summary

✅ Increased the color contrast on EuiSitewideSearch item meta labels to meet WCAG 4.5 contrast ratio requirement in both light mode and dark mode.

These colors are calculated using the makeHighContrastColor color function, but they did not take a background color into account. This means the color was being calculated with the assumption that the background was white. On hover, these items have a light blue background. These colors will now be calculated with the hover background color in mind.

🎨 Color Details & Changes

Light Mode Difference

image

Dark Mode Difference

image
Sitewide Type Color Before Contrast Before Color After (Light) Contrast After (Light) Color After (Dark) Contrast After (Dark)
Application #4e779c 4.14 #4a7194 4.5 #7ea6cc 4.7
Deployment #3b7d6a 4.25 #387765 4.6 #54B399 4.74
Article #8365a6 4.2 #7c609e 4.57 #ae96cb 4.6
Case #bc533e 4.13 #aa4b38 4.87 #eb836e 4.58
Platform #807234 4.2 #7a6c31 4.56 #D6BF57 6.56

QA

  • Use the PR preview to view the Basic Setup example. Select the search box and hover over list items. You may want to use the developer tools to activate the hover state for the drop down items. Confirm that the meta labels below the links are in high contrast in comparison to the background.
image

General checklist

  • Checked in both light and dark modes
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • Updated the Figma library counterpart
  • A changelog entry exists and is marked appropriately

breehall added 3 commits May 9, 2023 14:31
…rch meta item labels on hover. The color calculations were using a white background to create a contrasting shade instead of the light blue focus background.
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_6761/

Comment on lines +1 to +4
// The $euiFocusBackgroundColor without the alpha channel in light and dark mode
$euiSelectableTemplateFocusBackgroundLight: rgb(232, 241, 250);
$euiSelectableTemplateFocusBackgroundDark: rgb(35,56,77);

Copy link
Contributor Author

@breehall breehall May 9, 2023

Choose a reason for hiding this comment

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

I added these instead of using $euiFocusBackgeoundColor is because the alpha channel in the color was causing makeHighContrastColor to calculate a very light (near white color).

I also specified light and dark colors because $euiFocusBackgeoundColor is being used in both light and dark mode.

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_6761/

@breehall breehall requested a review from 1Copenut May 9, 2023 20:23
@breehall breehall marked this pull request as ready for review May 9, 2023 20:23
Copy link
Contributor

@1Copenut 1Copenut left a comment

Choose a reason for hiding this comment

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

👍 LGTM! Thank you for updating these @breehall. Your matrix of contrast ratios was very helpful. I ran a quick axe-core scan using light and dark backgrounds with the li:hover CSS enabled and all came back good there too.

…arch types for demo purposes"

This reverts commit 36e38fb.

Remove changes made to sitewide search example used for testing
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_6761/

@breehall breehall merged commit e8a5169 into elastic:main May 10, 2023
tkajtoch added a commit to elastic/kibana that referenced this pull request May 18, 2023
## Summary

`@elastic/[email protected]` ⏩ `@elastic/[email protected]`

---

## [`80.0.0`](https://github.com/elastic/eui/tree/v80.0.0)

- Improved the contrast ratio of meta labels within
`EuiSelectableTemplateSitewide` to meet WCAG AA guidelines.
([#6761](elastic/eui#6761))
- Added `vulnerabilityManagementApp` glyph to `EuiIcon`
([#6762](elastic/eui#6762))
- Added `logoVulnerabilityManagement` icon to `EuiIcon`
([#6763](elastic/eui#6763))
- Added `onPanelChange` callback to `EuiContextMenu` to provide consumer
access to `panelId` and `direction`.
([#6767](elastic/eui#6767))

**Bug fixes**

- Fixed `EuiComboBox` so `append` and `prepend` icon buttons are full
height and vertically centered.
([#6766](elastic/eui#6766))
- Improved the uniformity of dropdown components by hiding the dropdown
icon of disabled `EuiComboBox`s.
([#6768](elastic/eui#6768))

**Breaking changes**

- `EuiFieldNumber` now defaults the `step` prop to `"any"`
([#6760](elastic/eui#6760))
- EUI now globally resets a default Chromium browser style that was
decreasing the opacity of disabled `select` items.
([#6768](elastic/eui#6768))

---------

Co-authored-by: Kibana Machine <[email protected]>
delanni pushed a commit to delanni/kibana that referenced this pull request May 25, 2023
## Summary

`@elastic/[email protected]` ⏩ `@elastic/[email protected]`

---

## [`80.0.0`](https://github.com/elastic/eui/tree/v80.0.0)

- Improved the contrast ratio of meta labels within
`EuiSelectableTemplateSitewide` to meet WCAG AA guidelines.
([elastic#6761](elastic/eui#6761))
- Added `vulnerabilityManagementApp` glyph to `EuiIcon`
([elastic#6762](elastic/eui#6762))
- Added `logoVulnerabilityManagement` icon to `EuiIcon`
([elastic#6763](elastic/eui#6763))
- Added `onPanelChange` callback to `EuiContextMenu` to provide consumer
access to `panelId` and `direction`.
([elastic#6767](elastic/eui#6767))

**Bug fixes**

- Fixed `EuiComboBox` so `append` and `prepend` icon buttons are full
height and vertically centered.
([elastic#6766](elastic/eui#6766))
- Improved the uniformity of dropdown components by hiding the dropdown
icon of disabled `EuiComboBox`s.
([elastic#6768](elastic/eui#6768))

**Breaking changes**

- `EuiFieldNumber` now defaults the `step` prop to `"any"`
([elastic#6760](elastic/eui#6760))
- EUI now globally resets a default Chromium browser style that was
decreasing the opacity of disabled `select` items.
([elastic#6768](elastic/eui#6768))

---------

Co-authored-by: Kibana Machine <[email protected]>
@breehall breehall deleted the sitewide-search/links branch October 6, 2023 16:04
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.

(Accessibility) Sitewide app search links have color contrast ratio below 4.5:1
3 participants