Skip to content

Commit 85df599

Browse files
fix progress bar % value
1 parent d8e0242 commit 85df599

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed
Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,36 @@
11
.progress-bar {
2+
position: relative;
23
height: 1rem;
34
width: 100%;
45
background-color: rgb(243 244 246);
56
border-radius: 9999px;
6-
box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
77
overflow: hidden;
8+
box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
89
}
910

10-
.progress-bar-value {
11-
display: flex;
11+
.progress-bar-fill {
1212
height: 100%;
13-
align-items: center;
14-
justify-content: center;
1513
background-color: var(--progress-color, var(--primary-500));
16-
/* Uses config color, fallback to primary */
1714
border-radius: 9999px;
18-
box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
15+
transition: width 0.3s ease;
16+
}
17+
18+
.progress-bar-text {
19+
position: absolute;
20+
inset: 0;
21+
display: flex;
22+
align-items: center;
23+
justify-content: center;
1924
font-size: 0.75rem;
2025
font-weight: 700;
2126
color: white;
27+
pointer-events: none;
2228
}
2329

2430
.dark .progress-bar {
2531
background-color: rgb(31 41 55);
2632
}
2733

28-
.dark .progress-bar-value {
34+
.dark .progress-bar-fill {
2935
background-color: var(--progress-color, var(--primary-400));
30-
/* Uses config color, fallback to primary */
3136
}
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<div class="progress-bar" style="--progress-color: {{ $getColor() }};">
2-
<div class="progress-bar-value" style="width: {{ $getProgress() }}%;">
3-
{{ $getFormattedState() }}
4-
</div>
2+
<div class="progress-bar-fill" style="width: {{ $getProgress() }}%;"></div>
3+
<span class="progress-bar-text">{{ $getFormattedState() }}</span>
54
</div>

0 commit comments

Comments
 (0)