Back to CSS Progress Bars Gradient Pulse Pure CSS
Share
HTML
<div
  class="pb-pulse"
  role="progressbar"
  aria-valuenow="48"
  aria-valuemin="0"
  aria-valuemax="100"
  aria-label="Sync progress"
>
  <div class="pb-pulse-head">
    <strong>Syncing your workspace</strong>
    <span class="pb-pulse-pct">48%</span>
  </div>
  <div class="pb-pulse-rail">
    <div class="pb-pulse-fill" style="--pb-pulse-w: 48%">
      <span class="pb-pulse-edge" aria-hidden="true"></span>
    </div>
  </div>
</div>
CSS
.pb-pulse {
  width: 260px;
  display: grid;
  gap: 8px;
  font-family: system-ui, sans-serif;
}

.pb-pulse-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: #f0eeff;
  font-size: 13px;
}

.pb-pulse-head strong {
  font-weight: 600;
}

.pb-pulse-pct {
  font-family: "JetBrains Mono", monospace;
  color: #c4b5fd;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pb-pulse-rail {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.pb-pulse-fill {
  position: relative;
  width: var(--pb-pulse-w, 0%);
  height: 100%;
  background: linear-gradient(90deg, rgba(124, 108, 255, 0.25) 0%, #7c6cff 60%, #c4b5fd 100%);
  border-radius: inherit;
  transition: width 0.5s cubic-bezier(0.5, 0, 0.3, 1.2);
}

.pb-pulse-edge {
  position: absolute;
  right: -4px;
  top: -2px;
  bottom: -2px;
  width: 10px;
  background: radial-gradient(circle, #fff 0%, rgba(196, 181, 253, 0.55) 60%, transparent 80%);
  border-radius: 50%;
  animation: pbPulseGlow 1.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .pb-pulse-edge {
    animation: none;
  }
}

@keyframes pbPulseGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.25); }
}