Skip to content

Commit 87d6c29

Browse files
committed
feat(progress-bar): more buffer bar styles
1 parent cf033e1 commit 87d6c29

1 file changed

Lines changed: 73 additions & 71 deletions

File tree

core/src/components/progress-bar/progress-bar.scss

Lines changed: 73 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@use "../../themes/mixins" as mixins;
22

33
// Progress Bar
4-
// ------------------------------------------------------------------------
4+
// ---------------------------------------------
55

66
:host {
77
/**
@@ -49,7 +49,7 @@
4949
}
5050

5151
// Determinate progress bar
52-
// --------------------------------------------------
52+
// ---------------------------------------------
5353

5454
.progress,
5555
.progress-buffer-bar,
@@ -60,75 +60,42 @@
6060
transition: transform 150ms linear;
6161
}
6262

63-
// Progress and background bar
64-
// --------------------------------------------------
63+
// Progress Bar: progress, buffer bar, and circles
64+
// ---------------------------------------------
6565

6666
.progress,
6767
.progress-indeterminate {
6868
z-index: 2;
6969
}
7070

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-
7971
.progress-buffer-bar {
8072
z-index: 1;
8173
}
8274

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-
9175
.buffer-circles-container {
9276
overflow: hidden;
9377
}
9478

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);
11282
}
11383

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+
}
12187

122-
animation: secondary-indeterminate-translate 2s infinite linear;
88+
// Indeterminate
89+
.progress-indeterminate {
90+
background: var(--ion-progress-bar-indeterminate-progress-default-background);
91+
}
12392

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);
12895
}
12996

13097
// Progress Bar: Buffer Circles
131-
// ------------------------------------------------------------------------
98+
// ---------------------------------------------
13299

133100
.buffer-circles {
134101
background-image: radial-gradient(
@@ -149,7 +116,7 @@
149116
}
150117

151118
// Progress Bar: Shape Variants
152-
// -------------------------------------------------------------------------------
119+
// ---------------------------------------------
153120

154121
:host(.progress-bar-shape-round) {
155122
@include mixins.border-radius(var(--ion-progress-bar-shape-round-border-radius));
@@ -160,19 +127,21 @@
160127
}
161128

162129
// Progress Bar: Solid (buffer = 1)
163-
// -------------------------------------------------------------------------------
130+
// ---------------------------------------------
164131

165-
:host(.progress-bar-solid.progress-bar-determinate) .progress-buffer-bar {
132+
// Indeterminate
133+
:host(.progress-bar-solid.progress-bar-indeterminate) .progress-buffer-bar {
166134
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)
169137
);
170138
}
171139

172-
:host(.progress-bar-solid.progress-bar-indeterminate) .progress-buffer-bar {
140+
// Determinate
141+
:host(.progress-bar-solid.progress-bar-determinate) .progress-buffer-bar {
173142
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)
176145
);
177146
}
178147

@@ -186,13 +155,17 @@
186155
}
187156

188157
// Progress Bar: Color
189-
// ------------------------------------------------------------------------
158+
// ---------------------------------------------
190159

191160
// Indeterminate
192161
:host(.ion-color) .progress-indeterminate {
193162
background: var(--ion-progress-bar-indeterminate-progress-semantic-default-background);
194163
}
195164

165+
:host(.ion-color.progress-bar-indeterminate) .progress-buffer-bar {
166+
background: var(--ion-progress-bar-indeterminate-buffer-bar-semantic-default-background);
167+
}
168+
196169
// Determinate
197170
:host(.ion-color) .progress {
198171
background: var(--ion-progress-bar-determinate-progress-semantic-default-background);
@@ -202,10 +175,6 @@
202175
background: var(--ion-progress-bar-determinate-buffer-bar-semantic-default-background);
203176
}
204177

205-
:host(.ion-color.progress-bar-indeterminate) .progress-buffer-bar {
206-
background: var(--ion-progress-bar-indeterminate-buffer-bar-semantic-default-background);
207-
}
208-
209178
:host(.ion-color) .buffer-circles {
210179
background-image: radial-gradient(
211180
ellipse at center,
@@ -215,18 +184,16 @@
215184
);
216185
}
217186

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+
// ---------------------------------------------
222189

190+
// Reversed: if set to true, the animation will be reversed
191+
// and the bar will start at the top right
223192
:host(.progress-bar-reversed) {
224193
transform: scaleX(-1);
225194
}
226195

227-
// Progress Bar: Paused
228-
// ------------------------------------------------------------------------
229-
196+
// Paused
230197
:host(.progress-paused) {
231198
.indeterminate-bar-secondary,
232199
.indeterminate-bar-primary,
@@ -235,8 +202,43 @@
235202
}
236203
}
237204

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+
238240
// Progress Bar: Animation Keyframes
239-
// ------------------------------------------------------------------------
241+
// ---------------------------------------------
240242
// Source: https://github.com/material-components/material-components-web/blob/master/packages/mdc-linear-progress/_keyframes.scss
241243

242244
@keyframes primary-indeterminate-translate {

0 commit comments

Comments
 (0)