1 | /*
|
---|
2 | Definitions for progress elements and spinners.
|
---|
3 | */
|
---|
4 | $progress-back-color: #ddd !default; // Background color of <progress>.
|
---|
5 | $progress-fore-color: #555 !default; // Foreground color of <progress>.
|
---|
6 | $progress-height: 0.75rem !default; // Height of <progress>.
|
---|
7 | $progress-max-value: 1000 !default; // Arithmetic max value of <progress> - use integer values.
|
---|
8 | $progress-inline-name: 'inline' !default; // Class name for inline <progress> elements.
|
---|
9 | $progress-inline-width: 60% !default; // Width of inline <progress> elements.
|
---|
10 | $_include-spinner-donut: true !default; // [Hidden] Should spinner donuts be included? (boolean)
|
---|
11 | $spinner-donut-name: 'spinner' !default; // Class name for spinner donuts
|
---|
12 | $spinner-donut-size: 1.25rem !default; // Size of the spinner donuts
|
---|
13 | $spinner-donut-border-thickness: 0.25rem !default; // Border thickness for spinner donuts
|
---|
14 | $spinner-donut-back-color: #ddd !default; // Background color for spinner donuts
|
---|
15 | $spinner-donut-fore-color: #555 !default; // Foreground color for spinner donuts
|
---|
16 | // CSS variable name definitions [exercise caution if modifying these]
|
---|
17 | $progress-back-color-var: '--progress-back-color' !default;
|
---|
18 | $progress-fore-color-var: '--progress-fore-color' !default;
|
---|
19 | $spinner-donut-back-color-var: '--spinner-back-color' !default;
|
---|
20 | $spinner-donut-fore-color-var: '--spinner-fore-color' !default;
|
---|
21 | // == Uncomment below code if this module is used on its own ==
|
---|
22 | //
|
---|
23 | // $universal-margin: 0.5rem !default; // Universal margin for the most elements
|
---|
24 | // $universal-border-radius: 0.125rem !default; // Universal border-radius for most elements
|
---|
25 | // $universal-box-shadow: none !default; // Universal box-shadow for most elements
|
---|
26 | // $universal-margin-var: '--universal-margin' !default;
|
---|
27 | // $universal-border-radius-var: '--universal-border-radius' !default;
|
---|
28 | // $universal-box-shadow-var: '--universal-box-shadow' !default;
|
---|
29 | // :root {
|
---|
30 | // #{$universal-margin-var}: $universal-margin;
|
---|
31 | // #{$universal-border-radius-var}: $universal-border-radius;
|
---|
32 | // @if $universal-box-shadow != none {
|
---|
33 | // #{$universal-box-shadow-var}: $universal-box-shadow;
|
---|
34 | // }
|
---|
35 | // }
|
---|
36 | //
|
---|
37 | // ============================================================
|
---|
38 | // Check the `_progress_mixins.scss` file to find this module's mixins.
|
---|
39 | @import '_progress_mixins';
|
---|
40 | /* Progess module CSS variable definitions */
|
---|
41 | :root {
|
---|
42 | #{$progress-back-color-var}: $progress-back-color;
|
---|
43 | #{$progress-fore-color-var}: $progress-fore-color;
|
---|
44 | }
|
---|
45 | // Default styling for progress. Use mixins for alternate styles
|
---|
46 | progress {
|
---|
47 | display: block;
|
---|
48 | vertical-align: baseline; // Correct vertical alignment in some browsers.
|
---|
49 | -webkit-appearance: none;
|
---|
50 | -moz-appearance: none;
|
---|
51 | appearance: none;
|
---|
52 | height: $progress-height;
|
---|
53 | width: calc(100% - 2 * var(#{$universal-margin-var}));
|
---|
54 | margin: var(#{$universal-margin-var});
|
---|
55 | border: 0; // Removes default border
|
---|
56 | border-radius: calc(2 * var(#{$universal-border-radius-var}));
|
---|
57 | @if $universal-box-shadow != none {
|
---|
58 | box-shadow: var(#{$universal-box-shadow-var});
|
---|
59 | }
|
---|
60 | background: var(#{$progress-back-color-var});
|
---|
61 | color: var(#{$progress-fore-color-var});
|
---|
62 | // Foreground color on webkit browsers
|
---|
63 | &::-webkit-progress-value {
|
---|
64 | background: var(#{$progress-fore-color-var});
|
---|
65 | border-top-left-radius: calc(2 * var(#{$universal-border-radius-var}));
|
---|
66 | border-bottom-left-radius: calc(2 * var(#{$universal-border-radius-var}));
|
---|
67 | }
|
---|
68 | // Background color on webkit browser
|
---|
69 | &::-webkit-progress-bar {
|
---|
70 | background: var(#{$progress-back-color-var});
|
---|
71 | }
|
---|
72 | // Foreground color on Firefox
|
---|
73 | &::-moz-progress-bar {
|
---|
74 | background: var(#{$progress-fore-color-var});
|
---|
75 | border-top-left-radius: calc(2 * var(#{$universal-border-radius-var}));
|
---|
76 | border-bottom-left-radius: calc(2 * var(#{$universal-border-radius-var}));
|
---|
77 | }
|
---|
78 | &[value="#{$progress-max-value}"] {
|
---|
79 | &::-webkit-progress-value {
|
---|
80 | border-radius: calc(2 * var(#{$universal-border-radius-var}));
|
---|
81 | }
|
---|
82 | &::-moz-progress-bar {
|
---|
83 | border-radius: calc(2 * var(#{$universal-border-radius-var}));
|
---|
84 | }
|
---|
85 | }
|
---|
86 | &.#{$progress-inline-name} {
|
---|
87 | display: inline-block;
|
---|
88 | vertical-align: middle; // Align progress bar vertically to look better with text next to it.
|
---|
89 | width: $progress-inline-width;
|
---|
90 | }
|
---|
91 | }
|
---|
92 | // Style for donut spinner
|
---|
93 | @if $_include-spinner-donut {
|
---|
94 | :root {
|
---|
95 | #{$spinner-donut-back-color-var}: $spinner-donut-back-color;
|
---|
96 | #{$spinner-donut-fore-color-var}: $spinner-donut-fore-color;
|
---|
97 | }
|
---|
98 | // Donut spinner animation
|
---|
99 | @keyframes spinner-donut-anim {
|
---|
100 | 0% { transform: rotate(0deg); }
|
---|
101 | 100% { transform: rotate(360deg);}
|
---|
102 | }
|
---|
103 | .#{$spinner-donut-name} {
|
---|
104 | display: inline-block;
|
---|
105 | margin: var(#{$universal-margin-var});
|
---|
106 | border: $spinner-donut-border-thickness solid var(#{$spinner-donut-back-color-var});
|
---|
107 | border-left: $spinner-donut-border-thickness solid var(#{$spinner-donut-fore-color-var});
|
---|
108 | border-radius: 50%;
|
---|
109 | width: $spinner-donut-size;
|
---|
110 | height: $spinner-donut-size;
|
---|
111 | animation: spinner-donut-anim 1.2s linear infinite;
|
---|
112 | }
|
---|
113 | }
|
---|