Skip to content

Commit d409217

Browse files
committed
Close #24
1 parent a22c9ad commit d409217

File tree

1 file changed

+53
-53
lines changed

1 file changed

+53
-53
lines changed

css/components/progress.css

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Progress Container */
1+
/* Base Progress Container */
22
.progress {
33
position: relative;
44
width: 100%;
@@ -15,72 +15,73 @@
1515
/* Progress Bar */
1616
.progress-bar {
1717
height: 100%;
18-
transition: width 0.4s ease;
1918
display: flex;
2019
align-items: center;
2120
justify-content: center;
2221
font-weight: bold;
2322
color: white;
2423
white-space: nowrap;
2524
border-radius: inherit;
25+
transition: width 0.4s ease, background-color var(--transition-colors);
2626
}
2727

2828
/* Variants */
29-
.progress-primary .progress-bar { background-color: var(--primary); }
30-
.progress-secondary .progress-bar { background-color: var(--secondary); }
31-
.progress-success .progress-bar { background-color: var(--success); }
32-
.progress-danger .progress-bar { background-color: var(--danger); }
33-
.progress-warning .progress-bar { background-color: var(--warning); }
34-
.progress-info .progress-bar { background-color: var(--info); }
35-
36-
/* Striped Variant */
37-
.progress-striped .progress-bar {
29+
.progress[data-variant="primary"] .progress-bar { background-color: var(--primary); }
30+
.progress[data-variant="secondary"] .progress-bar { background-color: var(--secondary); }
31+
.progress[data-variant="success"] .progress-bar { background-color: var(--success); }
32+
.progress[data-variant="danger"] .progress-bar { background-color: var(--danger); }
33+
.progress[data-variant="warning"] .progress-bar { background-color: var(--warning); }
34+
.progress[data-variant="info"] .progress-bar { background-color: var(--info); }
35+
36+
/* Striped Style */
37+
.progress[data-striped="true"] .progress-bar {
3838
background-image: linear-gradient(
39-
45deg,
40-
rgba(255, 255, 255, 0.25) 25%,
41-
transparent 25%,
42-
transparent 50%,
43-
rgba(255, 255, 255, 0.25) 50%,
44-
rgba(255, 255, 255, 0.25) 75%,
45-
transparent 75%,
46-
transparent
39+
45deg,
40+
rgba(255, 255, 255, 0.25) 25%,
41+
transparent 25%,
42+
transparent 50%,
43+
rgba(255, 255, 255, 0.25) 50%,
44+
rgba(255, 255, 255, 0.25) 75%,
45+
transparent 75%,
46+
transparent
4747
);
4848
background-size: 1rem 1rem;
4949
}
5050

51-
/* Animated Stripes */
52-
.progress-animated .progress-bar {
51+
/* Animated Stripe */
52+
.progress[data-animated="true"] .progress-bar {
5353
background-image: linear-gradient(
54-
45deg,
55-
rgba(255, 255, 255, 0.25) 25%,
56-
transparent 25%,
57-
transparent 50%,
58-
rgba(255, 255, 255, 0.25) 50%,
59-
rgba(255, 255, 255, 0.25) 75%,
60-
transparent 75%,
61-
transparent
54+
45deg,
55+
rgba(255, 255, 255, 0.25) 25%,
56+
transparent 25%,
57+
transparent 50%,
58+
rgba(255, 255, 255, 0.25) 50%,
59+
rgba(255, 255, 255, 0.25) 75%,
60+
transparent 75%,
61+
transparent
6262
);
6363
background-size: 1rem 1rem;
6464
animation: progress-stripe-animation 1s linear infinite;
6565
}
6666

67-
/* Animated Pulse on Completion */
68-
.progress-bar.completed {
69-
animation: pulse 1s ease-in-out infinite;
67+
/* Pulse Animation on Completion */
68+
.progress-bar[data-completed="true"] {
69+
animation: progress-pulse-animation 1s ease-in-out infinite;
7070
}
7171

72-
/* Bordered Variant */
73-
.progress-bordered {
72+
/* Border Styling */
73+
.progress[data-bordered="true"] {
7474
border: 1px solid var(--neutral-300);
7575
}
7676

77-
/* Thickness Variants */
78-
.progress-thin { height: 0.5rem; }
79-
.progress-md { height: 1rem; }
80-
.progress-lg { height: 1.5rem; }
77+
/* Thickness Sizes */
78+
.progress[data-size="thin"] { height: 0.5rem; }
79+
.progress[data-size="medium"] { height: 1rem; }
80+
.progress[data-size="large"] { height: 1.5rem; }
8181

8282
/* Inside Percentage Label */
83-
.progress-bar-inside {
83+
.progress-bar[data-label="inside"]::after {
84+
content: attr(data-progress) '%';
8485
color: white;
8586
font-size: 0.75rem;
8687
position: absolute;
@@ -89,19 +90,20 @@
8990
z-index: 1;
9091
}
9192

92-
/* External Percentage Label */
93-
.progress-label {
93+
/* Outside Percentage Label */
94+
.progress[data-label="outside"]::after {
95+
content: attr(data-progress) '%';
9496
position: absolute;
9597
right: var(--space-2);
9698
font-size: 0.75rem;
9799
color: var(--neutral-900);
98100
z-index: 1;
99101
}
100102

101-
/* Step Progress - Multi-Step Progress */
103+
/* Multi-Step Progress */
102104
.progress-steps {
103105
display: flex;
104-
gap: var(--space-1); /* Creates spacing between steps */
106+
gap: var(--space-1); /* Spacing between steps */
105107
}
106108

107109
.progress-step {
@@ -119,19 +121,18 @@
119121
transition: background-color 0.3s ease, color 0.3s ease;
120122
}
121123

122-
/* Completed Step */
123-
.progress-step.completed {
124+
/* Step Progress Variants */
125+
.progress-step[data-step="completed"] {
124126
background-color: var(--success);
125127
color: white;
126128
}
127129

128-
/* Current Step */
129-
.progress-step.current {
130+
.progress-step[data-step="current"] {
130131
background-color: var(--primary);
131132
color: white;
132133
}
133134

134-
/* Step Label */
135+
/* Responsive Step Label */
135136
.progress-step-label {
136137
position: absolute;
137138
top: 50%;
@@ -141,13 +142,12 @@
141142

142143
/* Responsive Adjustments */
143144
@media (max-width: 600px) {
144-
.progress { height: 0.75rem; }
145-
.progress-label { font-size: 0.625rem; }
145+
.progress[data-size="medium"] { height: 0.75rem; }
146146
.progress-step {
147-
height: 0.75rem;
147+
height: 0.75rem;
148148
}
149149
.progress-step-label {
150-
font-size: 0.625rem;
150+
font-size: 0.625rem;
151151
}
152152
}
153153

@@ -158,7 +158,7 @@
158158
}
159159

160160
/* Keyframes for Pulse Animation */
161-
@keyframes pulse {
161+
@keyframes progress-pulse-animation {
162162
0% { transform: scale(1); opacity: 1; }
163163
50% { transform: scale(1.05); opacity: 0.8; }
164164
100% { transform: scale(1); opacity: 1; }

0 commit comments

Comments
 (0)