Skip to content

[CSS-in-JS] Convert EuiScreenReaderOnly - #5846

Merged
thompsongl merged 20 commits into
elastic:mainfrom
thompsongl:css-in-js/a11y
Jun 23, 2022
Merged

thompsongl merged 20 commits into
elastic:mainfrom
thompsongl:css-in-js/a11y

Conversation

@thompsongl

@thompsongl thompsongl commented Apr 26, 2022 •

Copy link
Copy Markdown
Contributor

Summary

Converts EuiScreenReaderOnly to @emotion styling and updates a lot of snapshots.
The euiScreenReaderOnly Sass mixin remains available but is no longer used by the .euiScreenReaderOnly selector. The .euiScreenReaderOnly is now an Emotion utility class that uses the euiScreenReaderOnly JS mixin.

For snapshot updates that required moving away from mount, I either used render(), mount().render() or whatever pattern was most common in the file.

Checklist

  • Checked in both light and dark modes
  • Checked in Chrome, Safari, Edge, and Firefox
  • Props have proper autodocs and playground toggles
  • Checked Code Sandbox works for any docs examples
  • Added or updated jest and cypress tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine

Copy link
Copy Markdown
Contributor

@thompsongl
thompsongl marked this pull request as ready for review April 28, 2022 14:54
@kibanamachine

Copy link
Copy Markdown
Contributor

@kibanamachine

Copy link
Copy Markdown
Contributor

@thompsongl
thompsongl requested a review from cee-chen May 4, 2022 15:37
@kibanamachine

Copy link
Copy Markdown
Contributor

@kibanamachine

Copy link
Copy Markdown
Contributor

@kibanamachine

Copy link
Copy Markdown
Contributor

@kibanamachine

Copy link
Copy Markdown
Contributor

@thompsongl

Copy link
Copy Markdown
Contributor Author

We could almost just have EuiScreenReaderOnly use the utility class for styling 🤔
showOnFocus would still use standard Emotion styling in that case.
But we do allow for consumers to turn off utility classes, so there would be extra logic involved.

@cee-chen

cee-chen commented Jun 22, 2022 •

Copy link
Copy Markdown
Contributor

But we do allow for consumers to turn off utility classes, so there would be extra logic involved.

If that's the case, personally my vote is to keep the two separate-ish / simply have the utility class call the euiScreenReaderOnly() mixin and call it a day. 🤷

@thompsongl

Copy link
Copy Markdown
Contributor Author

keep the two separate-ish

I think I agree. We can always revisit when optimization becomes more of a focus.

@thompsongl
thompsongl requested a review from cee-chen June 22, 2022 19:19
Comment thread src/global_styling/utility/utility.tsx Resolved
Comment thread src/components/accessibility/index.ts Resolved
@kibanamachine

Copy link
Copy Markdown
Contributor

@thompsongl
thompsongl requested a review from cee-chen June 23, 2022 19:55
@kibanamachine

Copy link
Copy Markdown
Contributor

@cee-chen cee-chen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes look great! Thanks for all the back and forth!

@kibanamachine

Copy link
Copy Markdown
Contributor

@thompsongl
thompsongl enabled auto-merge (squash) June 23, 2022 21:44
@thompsongl
thompsongl merged commit 3501341 into elastic:main Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants