Animated Gradient Border

This effect uses a pseudo-element with a conic gradient to create a rotating border. It's masked in a way that only the border area allows the gradient to shine through, or acts as a glow behind the main content. This technique is often used in Web3 and polished SaaS interfaces.

CSSTailwind

Glowing Border

Animated gradient blur

Code

/* Add to globals.css */
@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes rotate {
  to {
    --angle: 360deg;
  }
}

.gradient-border-box {
  position: relative;
  background: white;
  border-radius: 12px;
}

.gradient-border-box::after, .gradient-border-box::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  background-image: conic-gradient(from var(--angle), #ff4545, #00ff99, #006aff, #ff0095, #ff4545);
  z-index: -1;
  border-radius: 14px;
  animation: 3s rotate linear infinite;
}

.gradient-border-box::after {
  filter: blur(20px);
  opacity: 0.5;
}