|
1 | | -/* Progress Container */ |
| 1 | +/* Base Progress Container */ |
2 | 2 | .progress { |
3 | 3 | position: relative; |
4 | 4 | width: 100%; |
|
15 | 15 | /* Progress Bar */ |
16 | 16 | .progress-bar { |
17 | 17 | height: 100%; |
18 | | - transition: width 0.4s ease; |
19 | 18 | display: flex; |
20 | 19 | align-items: center; |
21 | 20 | justify-content: center; |
22 | 21 | font-weight: bold; |
23 | 22 | color: white; |
24 | 23 | white-space: nowrap; |
25 | 24 | border-radius: inherit; |
| 25 | + transition: width 0.4s ease, background-color var(--transition-colors); |
26 | 26 | } |
27 | 27 |
|
28 | 28 | /* 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 { |
38 | 38 | 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 |
47 | 47 | ); |
48 | 48 | background-size: 1rem 1rem; |
49 | 49 | } |
50 | 50 |
|
51 | | -/* Animated Stripes */ |
52 | | -.progress-animated .progress-bar { |
| 51 | +/* Animated Stripe */ |
| 52 | +.progress[data-animated="true"] .progress-bar { |
53 | 53 | 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 |
62 | 62 | ); |
63 | 63 | background-size: 1rem 1rem; |
64 | 64 | animation: progress-stripe-animation 1s linear infinite; |
65 | 65 | } |
66 | 66 |
|
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; |
70 | 70 | } |
71 | 71 |
|
72 | | -/* Bordered Variant */ |
73 | | -.progress-bordered { |
| 72 | +/* Border Styling */ |
| 73 | +.progress[data-bordered="true"] { |
74 | 74 | border: 1px solid var(--neutral-300); |
75 | 75 | } |
76 | 76 |
|
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; } |
81 | 81 |
|
82 | 82 | /* Inside Percentage Label */ |
83 | | -.progress-bar-inside { |
| 83 | +.progress-bar[data-label="inside"]::after { |
| 84 | + content: attr(data-progress) '%'; |
84 | 85 | color: white; |
85 | 86 | font-size: 0.75rem; |
86 | 87 | position: absolute; |
|
89 | 90 | z-index: 1; |
90 | 91 | } |
91 | 92 |
|
92 | | -/* External Percentage Label */ |
93 | | -.progress-label { |
| 93 | +/* Outside Percentage Label */ |
| 94 | +.progress[data-label="outside"]::after { |
| 95 | + content: attr(data-progress) '%'; |
94 | 96 | position: absolute; |
95 | 97 | right: var(--space-2); |
96 | 98 | font-size: 0.75rem; |
97 | 99 | color: var(--neutral-900); |
98 | 100 | z-index: 1; |
99 | 101 | } |
100 | 102 |
|
101 | | -/* Step Progress - Multi-Step Progress */ |
| 103 | +/* Multi-Step Progress */ |
102 | 104 | .progress-steps { |
103 | 105 | display: flex; |
104 | | - gap: var(--space-1); /* Creates spacing between steps */ |
| 106 | + gap: var(--space-1); /* Spacing between steps */ |
105 | 107 | } |
106 | 108 |
|
107 | 109 | .progress-step { |
|
119 | 121 | transition: background-color 0.3s ease, color 0.3s ease; |
120 | 122 | } |
121 | 123 |
|
122 | | -/* Completed Step */ |
123 | | -.progress-step.completed { |
| 124 | +/* Step Progress Variants */ |
| 125 | +.progress-step[data-step="completed"] { |
124 | 126 | background-color: var(--success); |
125 | 127 | color: white; |
126 | 128 | } |
127 | 129 |
|
128 | | -/* Current Step */ |
129 | | -.progress-step.current { |
| 130 | +.progress-step[data-step="current"] { |
130 | 131 | background-color: var(--primary); |
131 | 132 | color: white; |
132 | 133 | } |
133 | 134 |
|
134 | | -/* Step Label */ |
| 135 | +/* Responsive Step Label */ |
135 | 136 | .progress-step-label { |
136 | 137 | position: absolute; |
137 | 138 | top: 50%; |
|
141 | 142 |
|
142 | 143 | /* Responsive Adjustments */ |
143 | 144 | @media (max-width: 600px) { |
144 | | - .progress { height: 0.75rem; } |
145 | | - .progress-label { font-size: 0.625rem; } |
| 145 | + .progress[data-size="medium"] { height: 0.75rem; } |
146 | 146 | .progress-step { |
147 | | - height: 0.75rem; |
| 147 | + height: 0.75rem; |
148 | 148 | } |
149 | 149 | .progress-step-label { |
150 | | - font-size: 0.625rem; |
| 150 | + font-size: 0.625rem; |
151 | 151 | } |
152 | 152 | } |
153 | 153 |
|
|
158 | 158 | } |
159 | 159 |
|
160 | 160 | /* Keyframes for Pulse Animation */ |
161 | | -@keyframes pulse { |
| 161 | +@keyframes progress-pulse-animation { |
162 | 162 | 0% { transform: scale(1); opacity: 1; } |
163 | 163 | 50% { transform: scale(1.05); opacity: 0.8; } |
164 | 164 | 100% { transform: scale(1); opacity: 1; } |
|
0 commit comments