|
1 | 1 | @use "../../themes/mixins" as mixins; |
2 | 2 |
|
3 | 3 | // Progress Bar |
4 | | -// ------------------------------------------------------------------------ |
| 4 | +// --------------------------------------------- |
5 | 5 |
|
6 | 6 | :host { |
7 | 7 | /** |
|
49 | 49 | } |
50 | 50 |
|
51 | 51 | // Determinate progress bar |
52 | | -// -------------------------------------------------- |
| 52 | +// --------------------------------------------- |
53 | 53 |
|
54 | 54 | .progress, |
55 | 55 | .progress-buffer-bar, |
|
60 | 60 | transition: transform 150ms linear; |
61 | 61 | } |
62 | 62 |
|
63 | | -// Progress and background bar |
64 | | -// -------------------------------------------------- |
| 63 | +// Progress Bar: progress, buffer bar, and circles |
| 64 | +// --------------------------------------------- |
65 | 65 |
|
66 | 66 | .progress, |
67 | 67 | .progress-indeterminate { |
68 | 68 | z-index: 2; |
69 | 69 | } |
70 | 70 |
|
71 | | -.progress { |
72 | | - background: var(--ion-progress-bar-determinate-progress-default-background); |
73 | | -} |
74 | | - |
75 | | -.progress-indeterminate { |
76 | | - background: var(--ion-progress-bar-indeterminate-progress-default-background); |
77 | | -} |
78 | | - |
79 | 71 | .progress-buffer-bar { |
80 | 72 | z-index: 1; |
81 | 73 | } |
82 | 74 |
|
83 | | -:host(.progress-bar-determinate) .progress-buffer-bar { |
84 | | - background: var(--ion-progress-bar-determinate-buffer-bar-default-background); |
85 | | -} |
86 | | - |
87 | | -:host(.progress-bar-indeterminate) .progress-buffer-bar { |
88 | | - background: var(--ion-progress-bar-indeterminate-buffer-bar-default-background); |
89 | | -} |
90 | | - |
91 | 75 | .buffer-circles-container { |
92 | 76 | overflow: hidden; |
93 | 77 | } |
94 | 78 |
|
95 | | -// Indeterminate Animation |
96 | | -// -------------------------------------------------- |
97 | | - |
98 | | -.indeterminate-bar-primary { |
99 | | - /* stylelint-disable property-disallowed-list */ |
100 | | - top: 0; |
101 | | - right: 0; |
102 | | - bottom: 0; |
103 | | - left: -145.166611%; |
104 | | - /* stylelint-enable property-disallowed-list */ |
105 | | - |
106 | | - animation: primary-indeterminate-translate 2s infinite linear; |
107 | | - |
108 | | - .progress-indeterminate { |
109 | | - animation: primary-indeterminate-scale 2s infinite linear; |
110 | | - animation-play-state: inherit; |
111 | | - } |
| 79 | +// Determinate |
| 80 | +.progress { |
| 81 | + background: var(--ion-progress-bar-determinate-progress-default-background); |
112 | 82 | } |
113 | 83 |
|
114 | | -.indeterminate-bar-secondary { |
115 | | - /* stylelint-disable property-disallowed-list */ |
116 | | - top: 0; |
117 | | - right: 0; |
118 | | - bottom: 0; |
119 | | - left: -54.888891%; |
120 | | - /* stylelint-enable property-disallowed-list */ |
| 84 | +:host(.progress-bar-determinate) .progress-buffer-bar { |
| 85 | + background: var(--ion-progress-bar-determinate-buffer-bar-default-background); |
| 86 | +} |
121 | 87 |
|
122 | | - animation: secondary-indeterminate-translate 2s infinite linear; |
| 88 | +// Indeterminate |
| 89 | +.progress-indeterminate { |
| 90 | + background: var(--ion-progress-bar-indeterminate-progress-default-background); |
| 91 | +} |
123 | 92 |
|
124 | | - .progress-indeterminate { |
125 | | - animation: secondary-indeterminate-scale 2s infinite linear; |
126 | | - animation-play-state: inherit; |
127 | | - } |
| 93 | +:host(.progress-bar-indeterminate) .progress-buffer-bar { |
| 94 | + background: var(--ion-progress-bar-indeterminate-buffer-bar-default-background); |
128 | 95 | } |
129 | 96 |
|
130 | 97 | // Progress Bar: Buffer Circles |
131 | | -// ------------------------------------------------------------------------ |
| 98 | +// --------------------------------------------- |
132 | 99 |
|
133 | 100 | .buffer-circles { |
134 | 101 | background-image: radial-gradient( |
|
149 | 116 | } |
150 | 117 |
|
151 | 118 | // Progress Bar: Shape Variants |
152 | | -// ------------------------------------------------------------------------------- |
| 119 | +// --------------------------------------------- |
153 | 120 |
|
154 | 121 | :host(.progress-bar-shape-round) { |
155 | 122 | @include mixins.border-radius(var(--ion-progress-bar-shape-round-border-radius)); |
|
160 | 127 | } |
161 | 128 |
|
162 | 129 | // Progress Bar: Solid (buffer = 1) |
163 | | -// ------------------------------------------------------------------------------- |
| 130 | +// --------------------------------------------- |
164 | 131 |
|
165 | | -:host(.progress-bar-solid.progress-bar-determinate) .progress-buffer-bar { |
| 132 | +// Indeterminate |
| 133 | +:host(.progress-bar-solid.progress-bar-indeterminate) .progress-buffer-bar { |
166 | 134 | background: var( |
167 | | - --ion-progress-bar-determinate-buffer-bar-solid-default-background, |
168 | | - var(--ion-progress-bar-determinate-buffer-bar-default-background) |
| 135 | + --ion-progress-bar-indeterminate-buffer-bar-solid-default-background, |
| 136 | + var(--ion-progress-bar-indeterminate-buffer-bar-default-background) |
169 | 137 | ); |
170 | 138 | } |
171 | 139 |
|
172 | | -:host(.progress-bar-solid.progress-bar-indeterminate) .progress-buffer-bar { |
| 140 | +// Determinate |
| 141 | +:host(.progress-bar-solid.progress-bar-determinate) .progress-buffer-bar { |
173 | 142 | background: var( |
174 | | - --ion-progress-bar-indeterminate-buffer-bar-solid-default-background, |
175 | | - var(--ion-progress-bar-indeterminate-buffer-bar-default-background) |
| 143 | + --ion-progress-bar-determinate-buffer-bar-solid-default-background, |
| 144 | + var(--ion-progress-bar-determinate-buffer-bar-default-background) |
176 | 145 | ); |
177 | 146 | } |
178 | 147 |
|
|
186 | 155 | } |
187 | 156 |
|
188 | 157 | // Progress Bar: Color |
189 | | -// ------------------------------------------------------------------------ |
| 158 | +// --------------------------------------------- |
190 | 159 |
|
191 | 160 | // Indeterminate |
192 | 161 | :host(.ion-color) .progress-indeterminate { |
193 | 162 | background: var(--ion-progress-bar-indeterminate-progress-semantic-default-background); |
194 | 163 | } |
195 | 164 |
|
| 165 | +:host(.ion-color.progress-bar-indeterminate) .progress-buffer-bar { |
| 166 | + background: var(--ion-progress-bar-indeterminate-buffer-bar-semantic-default-background); |
| 167 | +} |
| 168 | + |
196 | 169 | // Determinate |
197 | 170 | :host(.ion-color) .progress { |
198 | 171 | background: var(--ion-progress-bar-determinate-progress-semantic-default-background); |
|
202 | 175 | background: var(--ion-progress-bar-determinate-buffer-bar-semantic-default-background); |
203 | 176 | } |
204 | 177 |
|
205 | | -:host(.ion-color.progress-bar-indeterminate) .progress-buffer-bar { |
206 | | - background: var(--ion-progress-bar-indeterminate-buffer-bar-semantic-default-background); |
207 | | -} |
208 | | - |
209 | 178 | :host(.ion-color) .buffer-circles { |
210 | 179 | background-image: radial-gradient( |
211 | 180 | ellipse at center, |
|
215 | 184 | ); |
216 | 185 | } |
217 | 186 |
|
218 | | -// Progress Bar: Reversed |
219 | | -// ------------------------------------------------------------------------ |
220 | | -// If reversed is set to true, the animation will be reversed |
221 | | -// and the bar will start at the top right |
| 187 | +// Progress Bar: States |
| 188 | +// --------------------------------------------- |
222 | 189 |
|
| 190 | +// Reversed: if set to true, the animation will be reversed |
| 191 | +// and the bar will start at the top right |
223 | 192 | :host(.progress-bar-reversed) { |
224 | 193 | transform: scaleX(-1); |
225 | 194 | } |
226 | 195 |
|
227 | | -// Progress Bar: Paused |
228 | | -// ------------------------------------------------------------------------ |
229 | | - |
| 196 | +// Paused |
230 | 197 | :host(.progress-paused) { |
231 | 198 | .indeterminate-bar-secondary, |
232 | 199 | .indeterminate-bar-primary, |
|
235 | 202 | } |
236 | 203 | } |
237 | 204 |
|
| 205 | +// Indeterminate Animation |
| 206 | +// --------------------------------------------- |
| 207 | + |
| 208 | +.indeterminate-bar-primary { |
| 209 | + /* stylelint-disable property-disallowed-list */ |
| 210 | + top: 0; |
| 211 | + right: 0; |
| 212 | + bottom: 0; |
| 213 | + left: -145.166611%; |
| 214 | + /* stylelint-enable property-disallowed-list */ |
| 215 | + |
| 216 | + animation: primary-indeterminate-translate 2s infinite linear; |
| 217 | + |
| 218 | + .progress-indeterminate { |
| 219 | + animation: primary-indeterminate-scale 2s infinite linear; |
| 220 | + animation-play-state: inherit; |
| 221 | + } |
| 222 | +} |
| 223 | + |
| 224 | +.indeterminate-bar-secondary { |
| 225 | + /* stylelint-disable property-disallowed-list */ |
| 226 | + top: 0; |
| 227 | + right: 0; |
| 228 | + bottom: 0; |
| 229 | + left: -54.888891%; |
| 230 | + /* stylelint-enable property-disallowed-list */ |
| 231 | + |
| 232 | + animation: secondary-indeterminate-translate 2s infinite linear; |
| 233 | + |
| 234 | + .progress-indeterminate { |
| 235 | + animation: secondary-indeterminate-scale 2s infinite linear; |
| 236 | + animation-play-state: inherit; |
| 237 | + } |
| 238 | +} |
| 239 | + |
238 | 240 | // Progress Bar: Animation Keyframes |
239 | | -// ------------------------------------------------------------------------ |
| 241 | +// --------------------------------------------- |
240 | 242 | // Source: https://github.com/material-components/material-components-web/blob/master/packages/mdc-linear-progress/_keyframes.scss |
241 | 243 |
|
242 | 244 | @keyframes primary-indeterminate-translate { |
|
0 commit comments