Skip to content

Commit

Permalink
feat(progress): support right aligned progress bar
Browse files Browse the repository at this point in the history
This PR allows to display the progress bar aligned to the right growing to the left
  • Loading branch information
lubber-de authored Oct 12, 2020
1 parent 998c222 commit 8bbda5f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/definitions/modules/progress.less
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

.ui.progress {
position: relative;
display: block;
display: flex;
max-width: 100%;
border: @border;
margin: @margin;
Expand Down Expand Up @@ -87,6 +87,16 @@
text-align: @progressTextAlign;
}

& when (@variationProgressRightAligned) {
.ui.right.aligned.progress {
justify-content: flex-end;
& .bar > .progress {
left: @progressRightAlignedLeft;
right: @progressRightAlignedRight;
}
}
}

/* Label */
.ui.progress > .label {
position: absolute;
Expand Down Expand Up @@ -229,12 +239,6 @@
}
}

& when (@variationProgressMultiple) {
/* Multiple */
.ui.multiple.progress {
display: flex;
}
}

/*******************************
States
Expand Down Expand Up @@ -316,6 +320,12 @@
animation: progress-active @activePulseDuration @defaultEasing infinite;
transform-origin: left;
}
& when (@variationProgressRightAligned) {
.ui.active.right.aligned.progress .bar::after {
transform-origin: right;
}
}

@keyframes progress-active {
0% {
opacity: @activePulseMaxOpacity;
Expand Down Expand Up @@ -396,7 +406,6 @@
}
.ui.progress.attached,
.ui.progress.attached .bar {
display: block;
height: @attachedHeight;
padding: 0;
overflow: hidden;
Expand Down
1 change: 1 addition & 0 deletions src/themes/default/globals/variation.variables
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@
@variationProgressActive: true;
@variationProgressAttached: true;
@variationProgressSpeeds: true;
@variationProgressRightAligned: true;
@variationProgressSizes: @variationAllSizes;

/* Rating */
Expand Down
2 changes: 2 additions & 0 deletions src/themes/default/modules/progress.variables
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
@progressTextShadow: none;
@progressFontWeight: @bold;
@progressTextAlign: left;
@progressRightAlignedRight: @progressLeft;
@progressRightAlignedLeft: @progressRight;

/* Label */
@labelWidth: 100%;
Expand Down

0 comments on commit 8bbda5f

Please sign in to comment.