Skip to content

Commit

Permalink
Use single css custom property for spinner size
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleeckx committed May 3, 2017
1 parent 4b5501d commit 056af06
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/WebComponents/Spinner/spinner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ $animation-time: 1s;
:host {
display: block;
position: relative;
width: var(--vi-spinner-width, var(--theme-h2));
height: var(--vi-spinner-height, var(--theme-h2));
width: var(--vi-spinner-size, var(--theme-h2));
height: var(--vi-spinner-size, var(--theme-h2));

&:not([block]) {
position: absolute;
left: 50%;
top: 50%;
transform: translate(calc(var(--vi-spinner-width, var(--theme-h2)) / -2), calc(var(--vi-spinner-height, var(--theme-h2)) / -2));
transform: translate(calc(var(--vi-spinner-size, var(--theme-h2)) / -2), calc(var(--vi-spinner-size, var(--theme-h2)) / -2));
}

.box {
Expand All @@ -23,30 +23,30 @@ $animation-time: 1s;
animation: loadAnimation $animation-time linear infinite;

&:nth-of-type(1) {
position: absolute;
top: 2.5%;
left: 2.5%;
animation-delay: -($animation-time / 4 ) * 3;
position: absolute;
top: 2.5%;
left: 2.5%;
animation-delay: -($animation-time / 4 ) * 3;
}

&:nth-of-type(2) {
position: absolute;
top: 2.5%;
right: 2.5%;
animation-delay: -($animation-time / 4 ) * 2;
position: absolute;
top: 2.5%;
right: 2.5%;
animation-delay: -($animation-time / 4 ) * 2;
}

&:nth-of-type(3) {
position: absolute;
bottom: 2.5%;
right: 2.5%;
animation-delay: -($animation-time / 4);
position: absolute;
bottom: 2.5%;
right: 2.5%;
animation-delay: -($animation-time / 4);
}

&:nth-of-type(4) {
position: absolute;
bottom: 2.5%;
left: 2.5%;
position: absolute;
bottom: 2.5%;
left: 2.5%;
}
}
}
Expand Down

0 comments on commit 056af06

Please sign in to comment.