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 #8036

Draft
wants to merge 46 commits into
base: main
Choose a base branch
from
Draft

High contrast mode #8036

wants to merge 46 commits into from

Conversation

cee-chen
Copy link
Member

@cee-chen cee-chen commented Sep 23, 2024

Summary

closes #8133
See #7509 (comment)

Screenshots

Extra reading/reference:

QA

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
    - [ ] Added or updated jest and cypress tests
  • 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 - N/A

@cee-chen cee-chen force-pushed the high-contrast-mode branch 3 times, most recently from 51185df to 9fd8832 Compare September 23, 2024 23:15
@cee-chen cee-chen self-assigned this Sep 23, 2024
@cee-chen cee-chen force-pushed the high-contrast-mode branch 4 times, most recently from dd894de to f284850 Compare September 25, 2024 21:47
mgadewoll added a commit to mgadewoll/eui that referenced this pull request Nov 1, 2024
mgadewoll added a commit to mgadewoll/eui that referenced this pull request Nov 4, 2024
mgadewoll added a commit to mgadewoll/eui that referenced this pull request Nov 7, 2024
- Prefer `modify` over computing at theme time, so that consumer modifications are also overridden and high contrast tokens are always enforced
- and set a border-bottom instead via box-shadow

+ code style cleanup - use optional chaining syntax instead of destructuring and correctly pass all options
+ fix file picker to correctly inherit border color, which is `lightShade` in any case in non-high-contrast mode
- current theme relies *a lot* on background colors alone, which Windows high contrast themes completely ignores, so we need a lot of border workarounds here
- contrast feels low otherwise, especially for disabled inputs
+ DRY out `euiFormControlDefaultShadow` usage/unsets with newer API
@cee-chen cee-chen force-pushed the high-contrast-mode branch 2 times, most recently from 54fe79d to 2a62528 Compare November 12, 2024 02:17
+ increase contrast of button group separators

+ add unique affordances for mac vs windows high contrast appearances
… high contrast mode

- have to use actual `border` CSS and not `box-shadow` due to Windows

+ fix obvious components that require this - flyouts, modals, toasts, and mobile table rows
@cee-chen cee-chen force-pushed the high-contrast-mode branch 2 times, most recently from 28f1786 to 90dfc63 Compare November 12, 2024 09:46
- CSS cleanup: replace line-height with flex centering instead
- this allows us to use borders of any thickness, and removes a lot of unnecessary vertical centering and tweaks (we can now remove all number styles completely)

+ remove background-image (which is ignored by Windows high contrast themes) in favor of a pseudo elementand border CSS

+ clean up horizontal focus rings
+ remove shadow on high contrast mode, it creates a weird border on Windows
+ simplify CSS selectors by using `:is()` instead of repeating `&`

+ address TODO
- requires a lot of SVG workarounds, since forced colors ignores background colors otherwise

- rerun VRT snapshots for updates and verification
- requires using a lot of `<svg>` elements

+ improve thumbs in all high contrast modes
+ massive cleanup/refactor of src-docs theme context, prefer toggle for light/dark mode

+ remove defunct tour on language selector
… ThemeContext

- might as well since we're already handling localStorage things there, saves us from waterfalling props unnecessarily
- at this point it's creating more false positives with nested template literals than it is being helpful
@kibanamachine
Copy link

Preview staging links for this PR:

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @cee-chen

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.

Add High contrast mode
3 participants