-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
defd7f0
commit 5aeda3b
Showing
6 changed files
with
57 additions
and
36 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { StyledSpinner } from './styles/spinner-styles'; | ||
|
||
export default function Spinner() { | ||
return <span className="components-spinner" />; | ||
return <StyledSpinner className="components-spinner" />; | ||
} |
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,49 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import styled from '@emotion/styled'; | ||
import { keyframes } from '@emotion/core'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { color, config } from '../../utils'; | ||
|
||
const spinAnimation = keyframes` | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
`; | ||
|
||
const topLeft = `calc( ( ${ config( 'spinnerSize' ) } - ${ config( | ||
'spinnerSize' | ||
) } * ( 2 / 3 ) ) / 2 )`; | ||
|
||
export const StyledSpinner = styled.span` | ||
display: inline-block; | ||
background-color: ${ color( 'gray.600' ) }; | ||
width: ${ config( 'spinnerSize' ) }; | ||
height: ${ config( 'spinnerSize' ) }; | ||
opacity: 0.7; | ||
margin: 5px 11px 0; | ||
border-radius: 100%; | ||
position: relative; | ||
&::before { | ||
content: ''; | ||
position: absolute; | ||
background-color: ${ color( 'white' ) }; | ||
top: ${ topLeft }; | ||
left: ${ topLeft }; | ||
width: calc( ${ config( 'spinnerSize' ) } / 4.5 ); | ||
height: calc( ${ config( 'spinnerSize' ) } / 4.5 ); | ||
border-radius: 100%; | ||
transform-origin: calc( ${ config( 'spinnerSize' ) } / 3 ) | ||
calc( ${ config( 'spinnerSize' ) } / 3 ); | ||
animation: ${ spinAnimation } 1s infinite linear; | ||
} | ||
`; |
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 |
---|---|---|
|
@@ -3,4 +3,5 @@ export default { | |
borderWidth: '1px', | ||
borderWidthFocus: '1.5px', | ||
borderWidthTab: '4px', | ||
spinnerSize: '18px', | ||
}; |