|
1 | 1 | @use "../../themes/mixins" as mixins; |
2 | 2 |
|
3 | | -// Progress Bar |
4 | | -// --------------------------------------------- |
| 3 | +// Progress Bar: Common Styles |
| 4 | +// -------------------------------------------------- |
5 | 5 |
|
6 | 6 | :host { |
7 | 7 | /** |
|
34 | 34 | height: 100%; |
35 | 35 | } |
36 | 36 |
|
| 37 | +.progress, |
| 38 | +.progress-indeterminate { |
| 39 | + z-index: 2; |
| 40 | +} |
| 41 | + |
| 42 | +.progress-buffer-bar { |
| 43 | + z-index: 1; |
| 44 | +} |
| 45 | + |
37 | 46 | .buffer-circles-container, |
38 | 47 | .buffer-circles { |
39 | 48 | @include mixins.position(0, 0, 0, 0); |
40 | 49 | position: absolute; |
41 | 50 | } |
42 | 51 |
|
| 52 | +.buffer-circles-container { |
| 53 | + overflow: hidden; |
| 54 | +} |
| 55 | + |
43 | 56 | // Extend a bit to overflow. The size of animated distance. |
44 | 57 | .buffer-circles { |
45 | 58 | /* stylelint-disable property-disallowed-list */ |
|
48 | 61 | /* stylelint-enable property-disallowed-list */ |
49 | 62 | } |
50 | 63 |
|
51 | | -// Determinate progress bar |
52 | | -// --------------------------------------------- |
| 64 | +// Progress Bar Types |
| 65 | +// -------------------------------------------------- |
53 | 66 |
|
| 67 | +// Determinate |
54 | 68 | .progress, |
55 | 69 | .progress-buffer-bar, |
56 | 70 | .buffer-circles-container { |
|
60 | 74 | transition: transform 150ms linear; |
61 | 75 | } |
62 | 76 |
|
63 | | -// Progress Bar: progress, buffer bar, and circles |
64 | | -// --------------------------------------------- |
65 | | - |
66 | | -.progress, |
67 | | -.progress-indeterminate { |
68 | | - z-index: 2; |
69 | | -} |
70 | | - |
71 | | -.progress-buffer-bar { |
72 | | - z-index: 1; |
73 | | -} |
74 | | - |
75 | | -.buffer-circles-container { |
76 | | - overflow: hidden; |
77 | | -} |
78 | | - |
79 | | -// Determinate |
80 | 77 | .progress { |
81 | 78 | background: var(--ion-progress-bar-determinate-progress-default-background); |
82 | 79 | } |
|
85 | 82 | background: var(--ion-progress-bar-determinate-buffer-bar-default-background); |
86 | 83 | } |
87 | 84 |
|
88 | | -// Indeterminate |
89 | | -.progress-indeterminate { |
90 | | - background: var(--ion-progress-bar-indeterminate-progress-default-background); |
91 | | -} |
92 | | - |
93 | | -:host(.progress-bar-indeterminate) .progress-buffer-bar { |
94 | | - background: var(--ion-progress-bar-indeterminate-buffer-bar-default-background); |
95 | | -} |
96 | | - |
97 | | -// Progress Bar: Buffer Circles |
98 | | -// --------------------------------------------- |
99 | | - |
100 | 85 | .buffer-circles { |
101 | 86 | background-image: radial-gradient( |
102 | 87 | ellipse at center, |
|
115 | 100 | animation: buffering 450ms infinite linear; |
116 | 101 | } |
117 | 102 |
|
118 | | -// Progress Bar: Shape Variants |
119 | | -// --------------------------------------------- |
| 103 | +// Indeterminate |
| 104 | +.progress-indeterminate { |
| 105 | + background: var(--ion-progress-bar-indeterminate-progress-default-background); |
| 106 | +} |
| 107 | + |
| 108 | +:host(.progress-bar-indeterminate) .progress-buffer-bar { |
| 109 | + background: var(--ion-progress-bar-indeterminate-buffer-bar-default-background); |
| 110 | +} |
| 111 | + |
| 112 | +// Progress Bar Shapes |
| 113 | +// -------------------------------------------------- |
120 | 114 |
|
121 | 115 | :host(.progress-bar-shape-round) { |
122 | 116 | @include mixins.border-radius(var(--ion-progress-bar-shape-round-border-radius)); |
|
126 | 120 | @include mixins.border-radius(var(--ion-progress-bar-shape-rectangular-border-radius)); |
127 | 121 | } |
128 | 122 |
|
129 | | -// Progress Bar: Solid (buffer = 1) |
130 | | -// --------------------------------------------- |
| 123 | +// Progress Bar Semantic Colors |
| 124 | +// -------------------------------------------------- |
131 | 125 |
|
132 | | -// Indeterminate |
133 | | -:host(.progress-bar-solid.progress-bar-indeterminate) .progress-buffer-bar { |
134 | | - background: var( |
135 | | - --ion-progress-bar-indeterminate-buffer-bar-solid-default-background, |
136 | | - var(--ion-progress-bar-indeterminate-buffer-bar-default-background) |
137 | | - ); |
| 126 | +// Determinate |
| 127 | +:host(.ion-color) .progress { |
| 128 | + background: var(--ion-progress-bar-determinate-progress-semantic-default-background); |
138 | 129 | } |
139 | 130 |
|
140 | | -// Determinate |
141 | | -:host(.progress-bar-solid.progress-bar-determinate) .progress-buffer-bar { |
| 131 | +:host(.ion-color.progress-bar-determinate:not(.progress-bar-solid)) .progress-buffer-bar { |
142 | 132 | background: var( |
143 | | - --ion-progress-bar-determinate-buffer-bar-solid-default-background, |
| 133 | + --ion-progress-bar-determinate-buffer-bar-semantic-default-background, |
144 | 134 | var(--ion-progress-bar-determinate-buffer-bar-default-background) |
145 | 135 | ); |
146 | 136 | } |
147 | 137 |
|
148 | | -:host(.progress-bar-solid) .buffer-circles { |
| 138 | +:host(.ion-color) .buffer-circles { |
149 | 139 | background-image: radial-gradient( |
150 | 140 | ellipse at center, |
151 | | - var(--ion-progress-bar-determinate-buffer-circles-solid-default-background) 0%, |
152 | | - var(--ion-progress-bar-determinate-buffer-circles-solid-default-background) 30%, |
| 141 | + var(--ion-progress-bar-determinate-buffer-circles-semantic-default-background) 0%, |
| 142 | + var(--ion-progress-bar-determinate-buffer-circles-semantic-default-background) 30%, |
153 | 143 | transparent 30% |
154 | 144 | ); |
155 | 145 | } |
156 | 146 |
|
157 | | -// Progress Bar: Color |
158 | | -// --------------------------------------------- |
159 | | - |
160 | 147 | // Indeterminate |
161 | 148 | :host(.ion-color) .progress-indeterminate { |
162 | 149 | background: var(--ion-progress-bar-indeterminate-progress-semantic-default-background); |
163 | 150 | } |
164 | 151 |
|
165 | | -:host(.ion-color.progress-bar-indeterminate) .progress-buffer-bar { |
166 | | - background: var(--ion-progress-bar-indeterminate-buffer-bar-semantic-default-background); |
167 | | -} |
168 | | - |
169 | | -// Determinate |
170 | | -:host(.ion-color) .progress { |
171 | | - background: var(--ion-progress-bar-determinate-progress-semantic-default-background); |
172 | | -} |
173 | | - |
174 | | -:host(.ion-color.progress-bar-determinate) .progress-buffer-bar { |
175 | | - background: var(--ion-progress-bar-determinate-buffer-bar-semantic-default-background); |
176 | | -} |
177 | | - |
178 | | -:host(.ion-color) .buffer-circles { |
179 | | - background-image: radial-gradient( |
180 | | - ellipse at center, |
181 | | - var(--ion-progress-bar-determinate-buffer-circles-semantic-default-background) 0%, |
182 | | - var(--ion-progress-bar-determinate-buffer-circles-semantic-default-background) 30%, |
183 | | - transparent 30% |
| 152 | +:host(.ion-color.progress-bar-indeterminate:not(.progress-bar-solid)) .progress-buffer-bar { |
| 153 | + background: var( |
| 154 | + --ion-progress-bar-indeterminate-buffer-bar-semantic-default-background, |
| 155 | + var(--ion-progress-bar-indeterminate-buffer-bar-default-background) |
184 | 156 | ); |
185 | 157 | } |
186 | 158 |
|
187 | | -// Progress Bar: States |
188 | | -// --------------------------------------------- |
| 159 | +// Progress Bar States |
| 160 | +// -------------------------------------------------- |
189 | 161 |
|
190 | | -// Reversed: if set to true, the animation will be reversed |
| 162 | +// Reversed |
| 163 | +// If set to true, the animation will be reversed |
191 | 164 | // and the bar will start at the top right |
192 | 165 | :host(.progress-bar-reversed) { |
193 | 166 | transform: scaleX(-1); |
|
202 | 175 | } |
203 | 176 | } |
204 | 177 |
|
205 | | -// Indeterminate Animation |
206 | | -// --------------------------------------------- |
| 178 | +// Progress Bar Solid State (buffer = 1) |
| 179 | +// -------------------------------------------------- |
207 | 180 |
|
| 181 | +// Determinate |
| 182 | +:host(.progress-bar-solid.progress-bar-determinate) .progress-buffer-bar { |
| 183 | + background: var( |
| 184 | + --ion-progress-bar-determinate-buffer-bar-solid-default-background, |
| 185 | + var(--ion-progress-bar-determinate-buffer-bar-default-background) |
| 186 | + ); |
| 187 | +} |
| 188 | + |
| 189 | +:host(.progress-bar-solid) .buffer-circles { |
| 190 | + background-image: radial-gradient( |
| 191 | + ellipse at center, |
| 192 | + var(--ion-progress-bar-determinate-buffer-circles-solid-default-background) 0%, |
| 193 | + var(--ion-progress-bar-determinate-buffer-circles-solid-default-background) 30%, |
| 194 | + transparent 30% |
| 195 | + ); |
| 196 | +} |
| 197 | + |
| 198 | +// Indeterminate |
| 199 | +:host(.progress-bar-solid.progress-bar-indeterminate) .progress-buffer-bar { |
| 200 | + background: var( |
| 201 | + --ion-progress-bar-indeterminate-buffer-bar-solid-default-background, |
| 202 | + var(--ion-progress-bar-indeterminate-buffer-bar-default-background) |
| 203 | + ); |
| 204 | +} |
| 205 | + |
| 206 | +// Progress Bar Animation |
| 207 | +// -------------------------------------------------- |
| 208 | + |
| 209 | +// Indeterminate |
208 | 210 | .indeterminate-bar-primary { |
209 | 211 | /* stylelint-disable property-disallowed-list */ |
210 | 212 | top: 0; |
|
237 | 239 | } |
238 | 240 | } |
239 | 241 |
|
240 | | -// Progress Bar: Animation Keyframes |
241 | | -// --------------------------------------------- |
242 | | -// Source: https://github.com/material-components/material-components-web/blob/master/packages/mdc-linear-progress/_keyframes.scss |
| 242 | +// Progress Bar Animation Keyframes |
| 243 | +// -------------------------------------------------- |
243 | 244 |
|
| 245 | +// Source: https://github.com/material-components/material-components-web/blob/6ceadb81df508ac08ab007c52c4d3dc1d811cc15/packages/mdc-linear-progress/_linear-progress.scss#L323-L357 |
244 | 246 | @keyframes primary-indeterminate-translate { |
245 | 247 | 0% { |
246 | 248 | transform: translateX(0); |
|
263 | 265 | } |
264 | 266 | } |
265 | 267 |
|
| 268 | +// Source: https://github.com/material-components/material-components-web/blob/6ceadb81df508ac08ab007c52c4d3dc1d811cc15/packages/mdc-linear-progress/_linear-progress.scss#L359-L379 |
266 | 269 | @keyframes primary-indeterminate-scale { |
267 | 270 | 0% { |
268 | 271 | transform: scaleX(0.08); |
|
285 | 288 | } |
286 | 289 | } |
287 | 290 |
|
| 291 | +// Source: https://github.com/material-components/material-components-web/blob/6ceadb81df508ac08ab007c52c4d3dc1d811cc15/packages/mdc-linear-progress/_linear-progress.scss#L381-L414 |
288 | 292 | @keyframes secondary-indeterminate-translate { |
289 | 293 | 0% { |
290 | 294 | animation-timing-function: cubic-bezier(0.15, 0, 0.515058, 0.409685); |
|
309 | 313 | } |
310 | 314 | } |
311 | 315 |
|
| 316 | +// Source: https://github.com/material-components/material-components-web/blob/6ceadb81df508ac08ab007c52c4d3dc1d811cc15/packages/mdc-linear-progress/_linear-progress.scss#L416-L452 |
312 | 317 | @keyframes secondary-indeterminate-scale { |
313 | 318 | 0% { |
314 | 319 | animation-timing-function: cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971); |
|
0 commit comments