Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/tools/mixins/_transitions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Transition Mixin
//


// Placeholder for prefers-reduced-motion query
%prefers-reduced-motion {
@media (prefers-reduced-motion: reduce) {
Expand Down Expand Up @@ -65,6 +64,7 @@
$imported-pulse: false !default;
$imported-flash: false !default;
$imported-spin: false !default;
$imported-loading-spinner: false !default;

@if $name == pulse and not $imported-pulse {
$imported-pulse: true;
Expand Down Expand Up @@ -92,6 +92,23 @@
opacity: 0;
}
}
} @else if $name == loading-spinner and not $imported-loading-spinner {
$imported-loading-spinner: true;
@keyframes loading-spinner {
from,
to {
transform: rotate(-360deg);
border-radius: 50%;
}
50% {
transform: rotate(0deg);
border-radius: 0;
}
to {
transform: rotate(360deg);
border-radius: 50%;
}
}
} @else if $name == spin and not $imported-spin {
$imported-spin: true;
@keyframes spin {
Expand Down
6 changes: 2 additions & 4 deletions src/tools/mixins/shapes/_animated.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
width: 1em;
height: 1em;
border: .15em solid currentColor;
border-right-color: transparent;
border-radius: $border-radius-pill;
// avoid using @mixin animation to generate radius independent of `$enable-transitions` option
animation: spin 1s infinite linear;
animation: loading-spinner 2s infinite cubic-bezier(.65, 0, .35, 1);
color: $color;
@include include-keyframe(spin);
@include include-keyframe(loading-spinner);
}
}

Expand Down