Skip to content

Commit 4c35b29

Browse files
authored
feat(progress): basic variant and support empty bar
Added new basic variant for progress, which removes the remaining bar background Supported a proper minimum bar width when it does not contain any content
1 parent 2f37293 commit 4c35b29

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

src/definitions/modules/progress.less

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@
3333
border-radius: @borderRadius;
3434
}
3535

36+
& when (@variationProgressBasic) {
37+
.ui.basic.progress {
38+
background: transparent;
39+
border: none;
40+
box-shadow: none;
41+
}
42+
}
43+
3644
.ui.progress:first-child {
3745
margin: @firstMargin;
3846
}
@@ -50,14 +58,16 @@
5058
line-height: 1;
5159
position: @barPosition;
5260
width: @barInitialWidth;
53-
min-width: @barMinWidth;
5461
background: @barBackground;
5562
border-radius: @barBorderRadius;
5663
transition: @barTransition;
5764
overflow: hidden;
65+
&:not(:empty) {
66+
min-width: @barMinWidth;
67+
}
5868
}
59-
.ui.ui.ui.progress:not([data-percent]):not(.indeterminate) .bar,
60-
.ui.ui.ui.progress[data-percent="0"]:not(.indeterminate) .bar {
69+
.ui.ui.ui.progress:not([data-percent]):not(.indeterminate) .bar:not(:empty),
70+
.ui.ui.ui.progress[data-percent="0"]:not(.indeterminate) .bar:not(:empty) {
6171
background: transparent;
6272
}
6373
.ui.progress[data-percent="0"] .bar .progress {
@@ -328,7 +338,9 @@
328338

329339
.ui.active.progress .bar {
330340
position: relative;
331-
min-width: @activeMinWidth;
341+
&:not(:empty) {
342+
min-width: @activeMinWidth;
343+
}
332344
}
333345
.ui.active.progress .bar::after {
334346
content: "";
@@ -384,7 +396,7 @@
384396
Inverted
385397
--------------- */
386398

387-
.ui.inverted.progress {
399+
.ui.inverted.progress:not(.basic) {
388400
background: @invertedBackground;
389401
border: @invertedBorder;
390402
}

src/themes/default/globals/variation.variables

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,7 @@
643643
/* Progress */
644644
@variationProgressInverted: true;
645645
@variationProgressDisabled: true;
646+
@variationProgressBasic: true;
646647
@variationProgressIndicating: true;
647648
@variationProgressIndeterminate: true;
648649
@variationProgressSliding: true;

0 commit comments

Comments
 (0)