| 1 |
/* ======================================== |
| 2 |
Progress Bar Block - Main Styles |
| 3 |
======================================== */ |
| 4 |
|
| 5 |
.bkbg-pb-wrap { |
| 6 |
--bkbg-pb-bar-height: 20px; |
| 7 |
--bkbg-pb-bar-spacing: 24px; |
| 8 |
--bkbg-pb-bar-radius: 10px; |
| 9 |
--bkbg-pb-track-color: #e5e7eb; |
| 10 |
--bkbg-pb-label-color: #1f2937; |
| 11 |
--bkbg-pb-percentage-color: #6b7280; |
| 12 |
--bkbg-pb-title-color: #1f2937; |
| 13 |
--bkbg-pb-animation-duration: 1000ms; |
| 14 |
|
| 15 |
width: 100%; |
| 16 |
} |
| 17 |
|
| 18 |
/* Title */ |
| 19 |
.bkbg-pb-title { |
| 20 |
font-family: var(--bkbg-pb-tt-font-family, inherit); |
| 21 |
font-size: var(--bkbg-pb-tt-font-size-d, 24px); |
| 22 |
font-weight: var(--bkbg-pb-tt-font-weight, 700); |
| 23 |
font-style: var(--bkbg-pb-tt-font-style, normal); |
| 24 |
text-decoration: var(--bkbg-pb-tt-text-decoration, none); |
| 25 |
text-transform: var(--bkbg-pb-tt-text-transform, none); |
| 26 |
line-height: var(--bkbg-pb-tt-line-height-d, 1.3); |
| 27 |
letter-spacing: var(--bkbg-pb-tt-letter-spacing-d, normal); |
| 28 |
word-spacing: var(--bkbg-pb-tt-word-spacing-d, normal); |
| 29 |
color: var(--bkbg-pb-title-color); |
| 30 |
margin-bottom: 24px; |
| 31 |
} |
| 32 |
|
| 33 |
/* List container */ |
| 34 |
.bkbg-pb-list { |
| 35 |
display: flex; |
| 36 |
flex-direction: column; |
| 37 |
gap: var(--bkbg-pb-bar-spacing); |
| 38 |
} |
| 39 |
|
| 40 |
/* Individual item */ |
| 41 |
.bkbg-pb-item { |
| 42 |
width: 100%; |
| 43 |
} |
| 44 |
|
| 45 |
/* Header with label and percentage */ |
| 46 |
.bkbg-pb-header { |
| 47 |
display: flex; |
| 48 |
justify-content: space-between; |
| 49 |
align-items: center; |
| 50 |
margin-bottom: 8px; |
| 51 |
} |
| 52 |
|
| 53 |
/* Label */ |
| 54 |
.bkbg-pb-label { |
| 55 |
font-family: var(--bkbg-pb-lb-font-family, inherit); |
| 56 |
font-size: var(--bkbg-pb-lb-font-size-d, 16px); |
| 57 |
font-weight: var(--bkbg-pb-lb-font-weight, 500); |
| 58 |
font-style: var(--bkbg-pb-lb-font-style, normal); |
| 59 |
text-decoration: var(--bkbg-pb-lb-text-decoration, none); |
| 60 |
text-transform: var(--bkbg-pb-lb-text-transform, none); |
| 61 |
line-height: var(--bkbg-pb-lb-line-height-d, 1.4); |
| 62 |
letter-spacing: var(--bkbg-pb-lb-letter-spacing-d, normal); |
| 63 |
word-spacing: var(--bkbg-pb-lb-word-spacing-d, normal); |
| 64 |
color: var(--bkbg-pb-label-color); |
| 65 |
} |
| 66 |
|
| 67 |
/* Percentage */ |
| 68 |
.bkbg-pb-percentage { |
| 69 |
font-family: var(--bkbg-pb-pct-font-family, inherit); |
| 70 |
font-size: var(--bkbg-pb-pct-font-size-d, 14px); |
| 71 |
font-weight: var(--bkbg-pb-pct-font-weight, 600); |
| 72 |
font-style: var(--bkbg-pb-pct-font-style, normal); |
| 73 |
text-decoration: var(--bkbg-pb-pct-text-decoration, none); |
| 74 |
text-transform: var(--bkbg-pb-pct-text-transform, none); |
| 75 |
line-height: var(--bkbg-pb-pct-line-height-d, 1); |
| 76 |
letter-spacing: var(--bkbg-pb-pct-letter-spacing-d, normal); |
| 77 |
word-spacing: var(--bkbg-pb-pct-word-spacing-d, normal); |
| 78 |
color: var(--bkbg-pb-percentage-color); |
| 79 |
font-variant-numeric: tabular-nums; |
| 80 |
} |
| 81 |
|
| 82 |
/* Track (background) */ |
| 83 |
.bkbg-pb-track { |
| 84 |
width: 100%; |
| 85 |
height: var(--bkbg-pb-bar-height); |
| 86 |
background: var(--bkbg-pb-track-color); |
| 87 |
border-radius: var(--bkbg-pb-bar-radius); |
| 88 |
overflow: hidden; |
| 89 |
position: relative; |
| 90 |
} |
| 91 |
|
| 92 |
/* Progress bar (filled part) */ |
| 93 |
.bkbg-pb-bar { |
| 94 |
height: 100%; |
| 95 |
border-radius: var(--bkbg-pb-bar-radius); |
| 96 |
transition: width var(--bkbg-pb-animation-duration) ease-out; |
| 97 |
display: flex; |
| 98 |
align-items: center; |
| 99 |
justify-content: flex-end; |
| 100 |
position: relative; |
| 101 |
} |
| 102 |
|
| 103 |
/* Percentage inside bar */ |
| 104 |
.bkbg-pb-percentage-inside { |
| 105 |
font-size: calc(var(--bkbg-pb-bar-height) * 0.6); |
| 106 |
font-weight: 600; |
| 107 |
color: #fff; |
| 108 |
padding-right: 8px; |
| 109 |
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); |
| 110 |
white-space: nowrap; |
| 111 |
} |
| 112 |
|
| 113 |
/* Percentage above bar */ |
| 114 |
.bkbg-pb-above { |
| 115 |
position: relative; |
| 116 |
height: 24px; |
| 117 |
margin-bottom: 4px; |
| 118 |
} |
| 119 |
|
| 120 |
.bkbg-pb-percentage-above { |
| 121 |
position: absolute; |
| 122 |
transform: translateX(-50%); |
| 123 |
font-family: var(--bkbg-pb-pct-font-family, inherit); |
| 124 |
font-size: var(--bkbg-pb-pct-font-size-d, 14px); |
| 125 |
font-weight: var(--bkbg-pb-pct-font-weight, 600); |
| 126 |
color: var(--bkbg-pb-percentage-color); |
| 127 |
font-variant-numeric: tabular-nums; |
| 128 |
transition: left var(--bkbg-pb-animation-duration) ease-out; |
| 129 |
} |
| 130 |
|
| 131 |
/* ======================================== |
| 132 |
Layout: Default |
| 133 |
======================================== */ |
| 134 |
|
| 135 |
/* Already defined above */ |
| 136 |
|
| 137 |
/* ======================================== |
| 138 |
Layout: Rounded |
| 139 |
======================================== */ |
| 140 |
|
| 141 |
.bkbg-pb-rounded .bkbg-pb-track { |
| 142 |
border-radius: 50px; |
| 143 |
} |
| 144 |
|
| 145 |
.bkbg-pb-rounded .bkbg-pb-bar { |
| 146 |
border-radius: 50px; |
| 147 |
} |
| 148 |
|
| 149 |
/* ======================================== |
| 150 |
Layout: Flat |
| 151 |
======================================== */ |
| 152 |
|
| 153 |
.bkbg-pb-flat .bkbg-pb-track { |
| 154 |
border-radius: 0; |
| 155 |
} |
| 156 |
|
| 157 |
.bkbg-pb-flat .bkbg-pb-bar { |
| 158 |
border-radius: 0; |
| 159 |
} |
| 160 |
|
| 161 |
/* ======================================== |
| 162 |
Layout: Thin |
| 163 |
======================================== */ |
| 164 |
|
| 165 |
.bkbg-pb-thin .bkbg-pb-track { |
| 166 |
height: calc(var(--bkbg-pb-bar-height) * 0.5); |
| 167 |
} |
| 168 |
|
| 169 |
.bkbg-pb-thin .bkbg-pb-bar { |
| 170 |
height: 100%; |
| 171 |
} |
| 172 |
|
| 173 |
.bkbg-pb-thin .bkbg-pb-percentage-inside { |
| 174 |
display: none; |
| 175 |
} |
| 176 |
|
| 177 |
/* ======================================== |
| 178 |
Layout: Thick |
| 179 |
======================================== */ |
| 180 |
|
| 181 |
.bkbg-pb-thick .bkbg-pb-track { |
| 182 |
height: calc(var(--bkbg-pb-bar-height) * 1.5); |
| 183 |
} |
| 184 |
|
| 185 |
/* ======================================== |
| 186 |
Effects: Stripes - applied via inline styles |
| 187 |
======================================== */ |
| 188 |
|
| 189 |
.bkbg-pb-striped-animated .bkbg-pb-bar { |
| 190 |
animation: bkbg-pb-stripes 1s linear infinite; |
| 191 |
} |
| 192 |
|
| 193 |
@keyframes bkbg-pb-stripes { |
| 194 |
0% { |
| 195 |
background-position: 40px 0, 0 0; |
| 196 |
} |
| 197 |
100% { |
| 198 |
background-position: 0 0, 0 0; |
| 199 |
} |
| 200 |
} |
| 201 |
|
| 202 |
/* ======================================== |
| 203 |
Effects: Glow - applied via inline styles |
| 204 |
======================================== */ |
| 205 |
|
| 206 |
/* ======================================== |
| 207 |
Effects: Gradient - shimmer animation |
| 208 |
======================================== */ |
| 209 |
|
| 210 |
.bkbg-pb-gradient-animated .bkbg-pb-bar { |
| 211 |
animation: bkbg-pb-gradient-shift 3s ease infinite; |
| 212 |
} |
| 213 |
|
| 214 |
@keyframes bkbg-pb-gradient-shift { |
| 215 |
0%, 100% { |
| 216 |
background-position: 0% 50%, 0 0; |
| 217 |
} |
| 218 |
50% { |
| 219 |
background-position: 100% 50%, 0 0; |
| 220 |
} |
| 221 |
} |
| 222 |
|
| 223 |
/* ======================================== |
| 224 |
Animation: Initial state (for scroll animation) |
| 225 |
======================================== */ |
| 226 |
|
| 227 |
.bkbg-pb-wrap[data-animate="1"]:not(.bkbg-pb-animated) .bkbg-pb-bar { |
| 228 |
width: 0 !important; |
| 229 |
} |
| 230 |
|
| 231 |
.bkbg-pb-wrap[data-animate="1"]:not(.bkbg-pb-animated) .bkbg-pb-percentage-above { |
| 232 |
left: 0 !important; |
| 233 |
} |
| 234 |
|
| 235 |
/* ======================================== |
| 236 |
Editor Styles |
| 237 |
======================================== */ |
| 238 |
|
| 239 |
.bkbg-pb-clickable { |
| 240 |
cursor: pointer; |
| 241 |
border: 1px dashed transparent; |
| 242 |
padding: 2px 4px; |
| 243 |
margin: -2px -4px; |
| 244 |
border-radius: 4px; |
| 245 |
transition: border-color 0.2s, background-color 0.2s; |
| 246 |
} |
| 247 |
|
| 248 |
.bkbg-pb-clickable:hover { |
| 249 |
border-color: var(--wp-admin-theme-color, #007cba); |
| 250 |
background-color: rgba(0, 124, 186, 0.05); |
| 251 |
} |
| 252 |
|
| 253 |
.bkbg-pb-input-active { |
| 254 |
border: 1px solid var(--wp-admin-theme-color, #007cba); |
| 255 |
outline: none; |
| 256 |
padding: 4px 8px; |
| 257 |
border-radius: 4px; |
| 258 |
font-family: inherit; |
| 259 |
background: #fff; |
| 260 |
} |
| 261 |
|
| 262 |
input.bkbg-pb-title.bkbg-pb-input-active { |
| 263 |
font: inherit; |
| 264 |
text-transform: inherit; |
| 265 |
font-style: inherit; |
| 266 |
text-decoration: inherit; |
| 267 |
letter-spacing: inherit; |
| 268 |
word-spacing: inherit; |
| 269 |
color: var(--bkbg-pb-title-color); |
| 270 |
width: 100%; |
| 271 |
margin-bottom: 24px; |
| 272 |
} |
| 273 |
|
| 274 |
input.bkbg-pb-label.bkbg-pb-input-active { |
| 275 |
font: inherit; |
| 276 |
text-transform: inherit; |
| 277 |
font-style: inherit; |
| 278 |
text-decoration: inherit; |
| 279 |
letter-spacing: inherit; |
| 280 |
word-spacing: inherit; |
| 281 |
color: var(--bkbg-pb-label-color); |
| 282 |
} |
| 283 |
|
| 284 |
/* Inspector Controls Styles */ |
| 285 |
.bkbg-pb-item-control { |
| 286 |
background: #f9fafb; |
| 287 |
border: 1px solid #e5e7eb; |
| 288 |
border-radius: 8px; |
| 289 |
padding: 12px; |
| 290 |
margin-bottom: 12px; |
| 291 |
} |
| 292 |
|
| 293 |
.bkbg-pb-item-header { |
| 294 |
display: flex; |
| 295 |
justify-content: space-between; |
| 296 |
align-items: center; |
| 297 |
margin-bottom: 12px; |
| 298 |
padding-bottom: 8px; |
| 299 |
border-bottom: 1px solid #e5e7eb; |
| 300 |
} |
| 301 |
|
| 302 |
.bkbg-pb-item-title { |
| 303 |
font-weight: 600; |
| 304 |
font-size: 13px; |
| 305 |
color: #374151; |
| 306 |
} |
| 307 |
|
| 308 |
.bkbg-pb-item-actions { |
| 309 |
display: flex; |
| 310 |
gap: 4px; |
| 311 |
} |
| 312 |
|
| 313 |
.bkbg-pb-color-row { |
| 314 |
display: flex; |
| 315 |
align-items: center; |
| 316 |
justify-content: space-between; |
| 317 |
margin-top: 8px; |
| 318 |
} |
| 319 |
|
| 320 |
.bkbg-pb-color-row span { |
| 321 |
font-size: 11px; |
| 322 |
text-transform: uppercase; |
| 323 |
font-weight: 500; |
| 324 |
color: #6b7280; |
| 325 |
} |
| 326 |
|
| 327 |
.bkbg-pb-color-btn { |
| 328 |
width: 32px; |
| 329 |
height: 32px; |
| 330 |
border-radius: 4px; |
| 331 |
border: 2px solid #e5e7eb; |
| 332 |
cursor: pointer; |
| 333 |
transition: border-color 0.2s; |
| 334 |
} |
| 335 |
|
| 336 |
.bkbg-pb-color-btn:hover { |
| 337 |
border-color: #9ca3af; |
| 338 |
} |
| 339 |
|
| 340 |
.bkbg-pb-add-btn { |
| 341 |
width: 100%; |
| 342 |
justify-content: center; |
| 343 |
margin-top: 8px; |
| 344 |
} |
| 345 |
|
| 346 |
/* ======================================== |
| 347 |
Editor: Item Hover States |
| 348 |
======================================== */ |
| 349 |
|
| 350 |
/* Individual item hover */ |
| 351 |
.bkbg-pb-item { |
| 352 |
position: relative; |
| 353 |
padding: 8px; |
| 354 |
margin: -8px; |
| 355 |
margin-bottom: calc(var(--bkbg-pb-bar-spacing) - 8px); |
| 356 |
border-radius: 6px; |
| 357 |
transition: background-color 0.15s; |
| 358 |
} |
| 359 |
|
| 360 |
.bkbg-pb-item:last-child { |
| 361 |
margin-bottom: -8px; |
| 362 |
} |
| 363 |
|
| 364 |
.bkbg-pb-item:hover, |
| 365 |
.bkbg-pb-item.bkbg-pb-item-hovered { |
| 366 |
background-color: rgba(0, 0, 0, 0.02); |
| 367 |
} |
| 368 |
|
| 369 |
/* Item actions toolbar */ |
| 370 |
.bkbg-pb-item .bkbg-pb-item-actions { |
| 371 |
position: absolute; |
| 372 |
top: 50%; |
| 373 |
right: -44px; |
| 374 |
transform: translateY(-50%); |
| 375 |
display: flex; |
| 376 |
flex-direction: column; |
| 377 |
gap: 2px; |
| 378 |
opacity: 0; |
| 379 |
visibility: hidden; |
| 380 |
transition: opacity 0.15s, visibility 0.15s; |
| 381 |
background: #fff; |
| 382 |
border-radius: 6px; |
| 383 |
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); |
| 384 |
padding: 4px; |
| 385 |
z-index: 10; |
| 386 |
} |
| 387 |
|
| 388 |
.bkbg-pb-item:hover .bkbg-pb-item-actions, |
| 389 |
.bkbg-pb-item.bkbg-pb-item-hovered .bkbg-pb-item-actions { |
| 390 |
opacity: 1; |
| 391 |
visibility: visible; |
| 392 |
} |
| 393 |
|
| 394 |
.bkbg-pb-item .bkbg-pb-item-actions .components-button { |
| 395 |
min-width: 28px; |
| 396 |
height: 28px; |
| 397 |
padding: 0; |
| 398 |
justify-content: center; |
| 399 |
} |
| 400 |
|
| 401 |
.bkbg-pb-item .bkbg-pb-item-actions .components-button:hover { |
| 402 |
background: #f3f4f6; |
| 403 |
} |
| 404 |
|
| 405 |
.bkbg-pb-item .bkbg-pb-item-actions .components-button.is-destructive:hover { |
| 406 |
background: #fef2f2; |
| 407 |
color: #dc2626; |
| 408 |
} |
| 409 |
|
| 410 |
/* Add button UI is standardized via assets/css/editor.css (.bkbg-editor-actions) */ |
| 411 |
|
| 412 |
/* ======================================== |
| 413 |
Responsive |
| 414 |
======================================== */ |
| 415 |
|
| 416 |
@media (max-width: 768px) { |
| 417 |
.bkbg-pb-wrap { |
| 418 |
--bkbg-pb-bar-height: 16px; |
| 419 |
} |
| 420 |
|
| 421 |
.bkbg-pb-header { |
| 422 |
flex-wrap: wrap; |
| 423 |
gap: 4px; |
| 424 |
} |
| 425 |
|
| 426 |
.bkbg-pb-item .bkbg-pb-item-actions { |
| 427 |
right: -40px; |
| 428 |
} |
| 429 |
} |
| 430 |
|
| 431 |
@media (max-width: 1024px) { |
| 432 |
.bkbg-pb-title { |
| 433 |
font-size: var(--bkbg-pb-tt-font-size-t, var(--bkbg-pb-tt-font-size-d, 24px)); |
| 434 |
line-height: var(--bkbg-pb-tt-line-height-t, var(--bkbg-pb-tt-line-height-d, 1.3)); |
| 435 |
letter-spacing: var(--bkbg-pb-tt-letter-spacing-t, var(--bkbg-pb-tt-letter-spacing-d, normal)); |
| 436 |
word-spacing: var(--bkbg-pb-tt-word-spacing-t, var(--bkbg-pb-tt-word-spacing-d, normal)); |
| 437 |
} |
| 438 |
.bkbg-pb-label { |
| 439 |
font-size: var(--bkbg-pb-lb-font-size-t, var(--bkbg-pb-lb-font-size-d, 16px)); |
| 440 |
line-height: var(--bkbg-pb-lb-line-height-t, var(--bkbg-pb-lb-line-height-d, 1.4)); |
| 441 |
letter-spacing: var(--bkbg-pb-lb-letter-spacing-t, var(--bkbg-pb-lb-letter-spacing-d, normal)); |
| 442 |
word-spacing: var(--bkbg-pb-lb-word-spacing-t, var(--bkbg-pb-lb-word-spacing-d, normal)); |
| 443 |
} |
| 444 |
.bkbg-pb-percentage, |
| 445 |
.bkbg-pb-percentage-above { |
| 446 |
font-size: var(--bkbg-pb-pct-font-size-t, var(--bkbg-pb-pct-font-size-d, 14px)); |
| 447 |
line-height: var(--bkbg-pb-pct-line-height-t, var(--bkbg-pb-pct-line-height-d, 1)); |
| 448 |
letter-spacing: var(--bkbg-pb-pct-letter-spacing-t, var(--bkbg-pb-pct-letter-spacing-d, normal)); |
| 449 |
word-spacing: var(--bkbg-pb-pct-word-spacing-t, var(--bkbg-pb-pct-word-spacing-d, normal)); |
| 450 |
} |
| 451 |
} |
| 452 |
|
| 453 |
@media (max-width: 767px) { |
| 454 |
.bkbg-pb-title { |
| 455 |
font-size: var(--bkbg-pb-tt-font-size-m, var(--bkbg-pb-tt-font-size-t, var(--bkbg-pb-tt-font-size-d, 24px))); |
| 456 |
line-height: var(--bkbg-pb-tt-line-height-m, var(--bkbg-pb-tt-line-height-t, var(--bkbg-pb-tt-line-height-d, 1.3))); |
| 457 |
letter-spacing: var(--bkbg-pb-tt-letter-spacing-m, var(--bkbg-pb-tt-letter-spacing-t, var(--bkbg-pb-tt-letter-spacing-d, normal))); |
| 458 |
word-spacing: var(--bkbg-pb-tt-word-spacing-m, var(--bkbg-pb-tt-word-spacing-t, var(--bkbg-pb-tt-word-spacing-d, normal))); |
| 459 |
} |
| 460 |
.bkbg-pb-label { |
| 461 |
font-size: var(--bkbg-pb-lb-font-size-m, var(--bkbg-pb-lb-font-size-t, var(--bkbg-pb-lb-font-size-d, 14px))); |
| 462 |
line-height: var(--bkbg-pb-lb-line-height-m, var(--bkbg-pb-lb-line-height-t, var(--bkbg-pb-lb-line-height-d, 1.4))); |
| 463 |
letter-spacing: var(--bkbg-pb-lb-letter-spacing-m, var(--bkbg-pb-lb-letter-spacing-t, var(--bkbg-pb-lb-letter-spacing-d, normal))); |
| 464 |
word-spacing: var(--bkbg-pb-lb-word-spacing-m, var(--bkbg-pb-lb-word-spacing-t, var(--bkbg-pb-lb-word-spacing-d, normal))); |
| 465 |
} |
| 466 |
.bkbg-pb-percentage, |
| 467 |
.bkbg-pb-percentage-above { |
| 468 |
font-size: var(--bkbg-pb-pct-font-size-m, var(--bkbg-pb-pct-font-size-t, var(--bkbg-pb-pct-font-size-d, 12px))); |
| 469 |
line-height: var(--bkbg-pb-pct-line-height-m, var(--bkbg-pb-pct-line-height-t, var(--bkbg-pb-pct-line-height-d, 1))); |
| 470 |
letter-spacing: var(--bkbg-pb-pct-letter-spacing-m, var(--bkbg-pb-pct-letter-spacing-t, var(--bkbg-pb-pct-letter-spacing-d, normal))); |
| 471 |
word-spacing: var(--bkbg-pb-pct-word-spacing-m, var(--bkbg-pb-pct-word-spacing-t, var(--bkbg-pb-pct-word-spacing-d, normal))); |
| 472 |
} |
| 473 |
} |
| 474 |
|