-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy path_loading-indicator.scss
62 lines (51 loc) · 1.89 KB
/
_loading-indicator.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
@use '@justeat/pie-design-tokens/dist/jet' as dt;
$loading-indicator-size-medium: 20px;
$loading-indicator-size-large: 48px;
$loading-indicator-color-default: dt.$color-orange;
$loading-indicator-borderSize: 3px;
$loading-indicator-borderColorOpaque-default: rgba(243, 109, 0, 0.2);
$loading-indicator-spacing: 20px;
@mixin spinnerColor($loading-indicator-color: $loading-indicator-color-default, $loading-indicator-borderColorOpaque: $loading-indicator-borderColorOpaque-default) {
.c-spinner {
border: $loading-indicator-borderSize solid $loading-indicator-color;
border-top: $loading-indicator-borderSize solid $loading-indicator-borderColorOpaque;
border-right: $loading-indicator-borderSize solid $loading-indicator-borderColorOpaque;
}
}
@mixin loadingIndicator($loading-indicator-size: 'medium') {
/**
* Components > Spinner Indicator
* =================================
*
* Example: f-searchbox - Loqate feature enabled (Full address capture)
*
* If you'd like to use it in your project you can include it by adding `@include loadingIndicator();` into your SCSS dependencies file.
* Then add `<span class=“c-spinner” />` to your html;
* If you’d like to change spinner colour add `@include spinnerColor(mainColourVar, opaqueColourVar);` to the parent element of the spinner styles.
*/
@keyframes spin {
from {
transform: rotate(0);
}
to {
transform: rotate(359deg);
}
}
.c-spinner-wrapper {
position: absolute;
right: 0;
}
@include spinnerColor();
.c-spinner {
margin-right: $loading-indicator-spacing;
border-radius: 50%;
animation: spin 1s linear 0s infinite;
@if $loading-indicator-size == 'large' {
width: $loading-indicator-size-large;
height: $loading-indicator-size-large;
} @else {
width: $loading-indicator-size-medium;
height: $loading-indicator-size-medium;
}
}
}