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

[High Contrast Mode] Ranges, color pickers, and date pickers #8199

Merged
merged 18 commits into from
Dec 5, 2024

Conversation

cee-chen
Copy link
Member

@cee-chen cee-chen commented Dec 3, 2024

Summary

Note

This PR merges into a feature branch. I also strongly recommend following along by commit and turning off whitespace changes (for instances where old CSS is wrapped in a high contrast mode check)

Just 3 of our most complex form components contrast-wise 🫠

EuiRange & EuiDualRange

  • Light and dark mode tooltips:

  • Keyboard focus:

  • Ticks and colored range thumbs/levels:

EuiColorPicker & EuiColorPalettePicker

  • Picker
    color picker
    (color artifacting is from the gif, should not be in production)
  • Palettes

EuiDatePicker, EuiDatePickerRange, & EuiSuperDatePicker

  • Calendar rendering (this was a fun challenge with minimal colors available 😅)


  • Super date picker

QA

See above component headings for staging links

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 - N/A
  • Code quality checklist
  • Release checklist - N/A, feature branch + I don't think I made any major changes to non-high-contrast UIs worth documenting
  • Designer checklist - N/A

- pass full theme context (matching all our other helpers) instead of just `euiTheme`

- use `is` type predicate instead of `as` cast

- use getters to repeat vars instead of comments (which updates the thumb bg color to match in high contrast mode)
- on focus, can be either the focus color or the level color

- we'll be using this var shortly for higher contrast borders
+ make the outlines of focused thumbs inherit from the level (more polished) in non-high contrast mode as well
…k mode visibility

+ tech debt - dogfood new arrow styles helper. this adds another mildly repetitive/annoying Emotion className, but that tradeoff is probably worth it

+ other misc CSS cleanup/simplifications

- minute Loki diffs appear to be coming from aliasing from the transparent border, but shouldn't be a meaningful change
- by using `aspect-ratio` instead of padding-bottom hack
- remove transparent background - it's more important that the thumb be visible

- remove box shadows and make borders/outlines extra thick

+ always show outlines, on mouse focus, not just keyboard focus

- open to feedback - dark mode feels better *while* focused, but not necessarily while not focused
+ DRY out `euiFormControlDefaultShadow` usage/unsets with newer API
- needs updating still isn't great, but I think this is the best I can do for now :/
@cee-chen cee-chen force-pushed the high-contrast-mode-4.5 branch from 3ba0768 to 543f22b Compare December 3, 2024 04:11
@cee-chen cee-chen marked this pull request as ready for review December 3, 2024 04:19
@cee-chen cee-chen requested a review from a team as a code owner December 3, 2024 04:19
@kibanamachine
Copy link

Preview staging links for this PR:

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

Copy link
Contributor

@mgadewoll mgadewoll 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 and works great. Awesome updates to ensure these components are properly visible/useful in high contrast mode! 🎉

@cee-chen cee-chen merged commit 87188e2 into elastic:high-contrast-mode Dec 5, 2024
4 checks passed
@cee-chen cee-chen deleted the high-contrast-mode-4.5 branch December 5, 2024 15:59
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