-
Notifications
You must be signed in to change notification settings - Fork 821
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
Changes from 6 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
01da1c7
Convert EuiBeacon to emotion
miukimiu 38d35af
Merge remote-tracking branch 'upstream/main' into beacon-emotion
miukimiu 9e287f6
Adding CL
miukimiu 80684d2
Adding `keyframes`
miukimiu 6b4afd2
adding animation only for prefers reduce motion no preference
miukimiu f8652a5
Merge remote-tracking branch 'upstream/main' into beacon-emotion
miukimiu 96c0264
Adding `shouldRenderCustomStyles`
miukimiu 7f26331
Better styles for when reduce motion is turned on
miukimiu 75dc285
Addressing PR review
miukimiu b7ebe30
Adding new snapshots
miukimiu 82f4768
Adding comment
miukimiu fcd01a1
change euiCanAnimate to a constant
thompsongl 0fa006b
Merge pull request #29 from thompsongl/beacon-emotion
miukimiu 9a54d6c
Merge remote-tracking branch 'upstream/main' into beacon-emotion
miukimiu 19f9897
Removing `renderWithStyles()` test
miukimiu cdbe8a6
Updating CL
miukimiu c2d9e46
Merge remote-tracking branch 'upstream/main' into beacon-emotion
miukimiu e20497f
Updating CL
miukimiu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { keyframes, css } from '@emotion/react'; | ||
import { euiPaletteColorBlind } from '../../services'; | ||
import { euiCanAnimate } from '../../global_styling/variables/_animations'; | ||
|
||
const visColors = euiPaletteColorBlind(); | ||
|
||
const euiBeaconPulseLarge = keyframes` | ||
0% { | ||
transform: scale(.1); | ||
opacity: 1; | ||
} | ||
|
||
70% { | ||
transform: scale(3); | ||
opacity: 0; | ||
} | ||
|
||
100% { | ||
opacity: 0; | ||
} | ||
`; | ||
|
||
const euiBeaconPulseSmall = keyframes` | ||
0% { | ||
transform: scale(.1); | ||
opacity: 1; | ||
} | ||
|
||
70% { | ||
transform: scale(2); | ||
opacity: 0; | ||
} | ||
|
||
100% { | ||
opacity: 0; | ||
} | ||
`; | ||
|
||
export const euiBeaconStyles = () => ({ | ||
// Base | ||
euiBeacon: css` | ||
position: relative; | ||
background-color: ${visColors[0]}; | ||
border-radius: 50%; | ||
|
||
&:before, | ||
&:after { | ||
position: absolute; | ||
content: ''; | ||
height: 100%; | ||
width: 100%; | ||
left: 0; | ||
top: 0; | ||
miukimiu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
background-color: transparent; | ||
border-radius: 50%; | ||
box-shadow: 0 0 1px 1px ${visColors[0]}; | ||
cchaos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
&:before { | ||
${euiCanAnimate( | ||
css` | ||
animation: ${euiBeaconPulseLarge} 2.5s infinite ease-out; | ||
` | ||
)} | ||
} | ||
|
||
&:after { | ||
${euiCanAnimate( | ||
css` | ||
animation: ${euiBeaconPulseSmall} 2.5s infinite ease-out 0.25s; | ||
` | ||
)} | ||
} | ||
miukimiu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
`, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
**CSS-in-JS conversions** | ||
|
||
- Converted `EuiBeacon` to Emotion | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you add a CL item that says the |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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...There was a problem hiding this comment.
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 theeuCanAnimate
mixin.