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

[Emotion] Converted EuiBeacon #5814

Merged
merged 18 commits into from
Apr 22, 2022
Merged

[Emotion] Converted EuiBeacon #5814

merged 18 commits into from
Apr 22, 2022

Conversation

miukimiu
Copy link
Contributor

@miukimiu miukimiu commented Apr 19, 2022

Summary

This PR converts the EuiBeacon to Emotion.

  • The animation now only runs if prefers-reduced-motion: no-preference.
  • Added a test shouldRenderCustomStyles()

How to test

You can test by comparing the new implementation with the old one.

Beacon:

Beacon in tour component:

Things to look out for when moving styles

  • [ ] Anything in the backlog that could be a quick fix for that component?
  • [ ] Convert global Sass vars to JS version like sizing
  • [ ] Convert component-specific Sass vars to exported JS versions
  • Convert side specific padding, margin, and position to -inline and -block (Logical properties)
  • [ ] Reduce specificity where possible (usually by reducing class name chaining)
  • [ ] Use gap property to add margin between items if using flex
  • [ ] Can any still existing .js files be converted to TS?

QA

  • Do className, css, and style props work properly when passed by the consumer
  • Does the rendered class read as expected

Checklist

  • Checked in both light and dark modes
  • [ ] Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
  • ~[ ] Props have proper autodocs and playground toggles
  • [ ] Added documentation
  • [ ] 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
  • [ ] Updated the Figma library counterpart
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@miukimiu miukimiu changed the title [Draft] Convert EuiBeacon to Emotion [Emotion] Converted EuiBeacon Apr 20, 2022
@miukimiu miukimiu marked this pull request as ready for review April 20, 2022 13:25
@@ -3,7 +3,7 @@
exports[`EuiBeacon accepts size 1`] = `
<div
aria-label="aria-label"
class="euiBeacon testClass1 testClass2"
class="euiBeacon testClass1 testClass2 css-haebed-euiBeacon-euiCanAnimate-euiBeacon-euiCanAnimate-euiBeacon"
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why this one is outputting -euiBeacon so many times...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested and it is because of the :before and :after. I also showed it to @chandlerprall and he will take a look while trying to improve the euCanAnimate mixin.

src/components/beacon/beacon.styles.ts Outdated Show resolved Hide resolved
src/components/beacon/beacon.styles.ts Show resolved Hide resolved
src/components/beacon/beacon.styles.ts Outdated Show resolved Hide resolved
@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@thompsongl
Copy link
Contributor

miukimiu#29 is one idea for fixing euiCanAnimate

@kibanamachine
Copy link

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

@miukimiu miukimiu requested a review from cchaos April 21, 2022 12:59
Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

LGTM! Love the stopped-motion version. 😍

@@ -0,0 +1,3 @@
**CSS-in-JS conversions**

- Converted `EuiBeacon` to Emotion
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a CL item that says the canAnimate hooks have been changed to a constant?

@kibanamachine
Copy link

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

@miukimiu miukimiu merged commit 3c427b1 into elastic:main Apr 22, 2022
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.

None yet

5 participants