Skip to content

Commit 8bbda5f

Browse files
authored
feat(progress): support right aligned progress bar
This PR allows to display the progress bar aligned to the right growing to the left
1 parent 998c222 commit 8bbda5f

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

src/definitions/modules/progress.less

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
.ui.progress {
2626
position: relative;
27-
display: block;
27+
display: flex;
2828
max-width: 100%;
2929
border: @border;
3030
margin: @margin;
@@ -87,6 +87,16 @@
8787
text-align: @progressTextAlign;
8888
}
8989

90+
& when (@variationProgressRightAligned) {
91+
.ui.right.aligned.progress {
92+
justify-content: flex-end;
93+
& .bar > .progress {
94+
left: @progressRightAlignedLeft;
95+
right: @progressRightAlignedRight;
96+
}
97+
}
98+
}
99+
90100
/* Label */
91101
.ui.progress > .label {
92102
position: absolute;
@@ -229,12 +239,6 @@
229239
}
230240
}
231241

232-
& when (@variationProgressMultiple) {
233-
/* Multiple */
234-
.ui.multiple.progress {
235-
display: flex;
236-
}
237-
}
238242

239243
/*******************************
240244
States
@@ -316,6 +320,12 @@
316320
animation: progress-active @activePulseDuration @defaultEasing infinite;
317321
transform-origin: left;
318322
}
323+
& when (@variationProgressRightAligned) {
324+
.ui.active.right.aligned.progress .bar::after {
325+
transform-origin: right;
326+
}
327+
}
328+
319329
@keyframes progress-active {
320330
0% {
321331
opacity: @activePulseMaxOpacity;
@@ -396,7 +406,6 @@
396406
}
397407
.ui.progress.attached,
398408
.ui.progress.attached .bar {
399-
display: block;
400409
height: @attachedHeight;
401410
padding: 0;
402411
overflow: hidden;

src/themes/default/globals/variation.variables

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@
464464
@variationProgressActive: true;
465465
@variationProgressAttached: true;
466466
@variationProgressSpeeds: true;
467+
@variationProgressRightAligned: true;
467468
@variationProgressSizes: @variationAllSizes;
468469

469470
/* Rating */

src/themes/default/modules/progress.variables

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
@progressTextShadow: none;
4545
@progressFontWeight: @bold;
4646
@progressTextAlign: left;
47+
@progressRightAlignedRight: @progressLeft;
48+
@progressRightAlignedLeft: @progressRight;
4749

4850
/* Label */
4951
@labelWidth: 100%;

0 commit comments

Comments
 (0)