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

[CSS-in-JS] Convert EuiScreenReaderOnly #5846

Merged
merged 20 commits into from
Jun 23, 2022

Conversation

thompsongl
Copy link
Contributor

@thompsongl thompsongl commented Apr 26, 2022

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

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

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

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

@kibanamachine
Copy link

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

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

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

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@thompsongl
Copy link
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
Copy link
Member

cee-chen commented Jun 22, 2022

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
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
@kibanamachine
Copy link

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

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

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

Copy link
Member

@cee-chen cee-chen left a comment

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

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

@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