|
1 | | -@import "../../themes/mixins"; |
| 1 | +@use "../../themes/mixins" as mixins; |
2 | 2 |
|
3 | | -// Progress bar |
| 3 | +// Progress Bar |
4 | 4 | // ------------------------------------------------------------------------ |
5 | 5 |
|
6 | | -// Host has no background by default - this will be added to the progress-buffer-bar |
7 | 6 | :host { |
| 7 | + /** |
| 8 | + * @prop --ion-progress-bar-determinate-buffer-bar-default-background: Background of the progress track, or the buffer bar if `buffer` is set |
| 9 | + * @prop --ion-progress-bar-determinate-progress-default-background: Background of the progress bar representing the current value |
| 10 | + */ |
| 11 | + |
8 | 12 | display: block; |
9 | 13 |
|
10 | 14 | position: relative; |
11 | 15 |
|
12 | 16 | width: 100%; |
| 17 | + height: var(--ion-progress-bar-height); |
13 | 18 |
|
14 | 19 | contain: strict; |
15 | 20 |
|
|
22 | 27 | .indeterminate-bar-primary, |
23 | 28 | .indeterminate-bar-secondary, |
24 | 29 | .progress-buffer-bar { |
25 | | - @include position(0, 0, 0, 0); |
| 30 | + @include mixins.position(0, 0, 0, 0); |
26 | 31 | position: absolute; |
27 | 32 |
|
28 | 33 | width: 100%; |
|
31 | 36 |
|
32 | 37 | .buffer-circles-container, |
33 | 38 | .buffer-circles { |
34 | | - @include position(0, 0, 0, 0); |
| 39 | + @include mixins.position(0, 0, 0, 0); |
35 | 40 | position: absolute; |
36 | 41 | } |
37 | 42 |
|
|
60 | 65 |
|
61 | 66 | .progress, |
62 | 67 | .progress-indeterminate { |
63 | | - background: var(--progress-background); |
64 | | - |
65 | 68 | z-index: 2; |
66 | 69 | } |
67 | 70 |
|
68 | | -.progress-buffer-bar { |
69 | | - background: var(--background); |
| 71 | +.progress { |
| 72 | + background: var(--ion-progress-bar-determinate-progress-default-background); |
| 73 | +} |
70 | 74 |
|
| 75 | +.progress-indeterminate { |
| 76 | + background: var(--ion-progress-bar-indeterminate-progress-default-background); |
| 77 | +} |
| 78 | + |
| 79 | +.progress-buffer-bar { |
71 | 80 | z-index: 1; |
72 | 81 | } |
73 | 82 |
|
| 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 | + |
74 | 91 | .buffer-circles-container { |
75 | 92 | overflow: hidden; |
76 | 93 | } |
77 | 94 |
|
78 | | -// MD based animation on indeterminate type |
| 95 | +// Indeterminate Animation |
79 | 96 | // -------------------------------------------------- |
80 | 97 |
|
81 | 98 | .indeterminate-bar-primary { |
|
114 | 131 | // ------------------------------------------------------------------------ |
115 | 132 |
|
116 | 133 | .buffer-circles { |
117 | | - background-image: radial-gradient(ellipse at center, var(--background) 0%, var(--background) 30%, transparent 30%); |
| 134 | + background-image: radial-gradient( |
| 135 | + ellipse at center, |
| 136 | + var(--ion-progress-bar-determinate-buffer-circles-default-background) 0%, |
| 137 | + var(--ion-progress-bar-determinate-buffer-circles-default-background) 30%, |
| 138 | + transparent 30% |
| 139 | + ); |
118 | 140 |
|
119 | 141 | /* stylelint-disable property-disallowed-list */ |
120 | 142 | background-repeat: repeat-x; |
|
126 | 148 | animation: buffering 450ms infinite linear; |
127 | 149 | } |
128 | 150 |
|
| 151 | +// Progress Bar: Shape Variants |
| 152 | +// ------------------------------------------------------------------------------- |
| 153 | + |
| 154 | +:host(.progress-bar-shape-round) { |
| 155 | + @include mixins.border-radius(var(--ion-progress-bar-shape-round-border-radius)); |
| 156 | +} |
| 157 | + |
| 158 | +:host(.progress-bar-shape-rectangular) { |
| 159 | + @include mixins.border-radius(var(--ion-progress-bar-shape-rectangular-border-radius)); |
| 160 | +} |
| 161 | + |
| 162 | +// Progress Bar: Solid (buffer = 1) |
| 163 | +// ------------------------------------------------------------------------------- |
| 164 | + |
| 165 | +:host(.progress-bar-solid.progress-bar-determinate) .progress-buffer-bar { |
| 166 | + background: var( |
| 167 | + --ion-progress-bar-determinate-buffer-bar-solid-default-background, |
| 168 | + var(--ion-progress-bar-determinate-buffer-bar-default-background) |
| 169 | + ); |
| 170 | +} |
| 171 | + |
| 172 | +:host(.progress-bar-solid.progress-bar-indeterminate) .progress-buffer-bar { |
| 173 | + background: var( |
| 174 | + --ion-progress-bar-indeterminate-buffer-bar-solid-default-background, |
| 175 | + var(--ion-progress-bar-indeterminate-buffer-bar-default-background) |
| 176 | + ); |
| 177 | +} |
| 178 | + |
| 179 | +:host(.progress-bar-solid) .buffer-circles { |
| 180 | + background-image: radial-gradient( |
| 181 | + ellipse at center, |
| 182 | + var(--ion-progress-bar-determinate-buffer-circles-solid-default-background) 0%, |
| 183 | + var(--ion-progress-bar-determinate-buffer-circles-solid-default-background) 30%, |
| 184 | + transparent 30% |
| 185 | + ); |
| 186 | +} |
| 187 | + |
| 188 | +// Progress Bar: Color |
| 189 | +// ------------------------------------------------------------------------ |
| 190 | + |
| 191 | +// Indeterminate |
| 192 | +:host(.ion-color) .progress-indeterminate { |
| 193 | + background: var(--ion-progress-bar-indeterminate-progress-semantic-default-background); |
| 194 | +} |
| 195 | + |
| 196 | +// Determinate |
| 197 | +:host(.ion-color) .progress { |
| 198 | + background: var(--ion-progress-bar-determinate-progress-semantic-default-background); |
| 199 | +} |
| 200 | + |
| 201 | +:host(.ion-color.progress-bar-determinate) .progress-buffer-bar { |
| 202 | + background: var(--ion-progress-bar-determinate-buffer-bar-semantic-default-background); |
| 203 | +} |
| 204 | + |
| 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 | +:host(.ion-color) .buffer-circles { |
| 210 | + background-image: radial-gradient( |
| 211 | + ellipse at center, |
| 212 | + var(--ion-progress-bar-determinate-buffer-circles-semantic-default-background) 0%, |
| 213 | + var(--ion-progress-bar-determinate-buffer-circles-semantic-default-background) 30%, |
| 214 | + transparent 30% |
| 215 | + ); |
| 216 | +} |
| 217 | + |
129 | 218 | // Progress Bar: Reversed |
130 | 219 | // ------------------------------------------------------------------------ |
131 | 220 | // If reversed is set to true, the animation will be reversed |
|
0 commit comments