Skip to content

Interpolated Colour Stops

A copy-paste animated gradients component in pure HTML & CSS. Zero dependencies, framework-agnostic, MIT-licensed.

Animated GradientsHTMLCSSany framework

Copy into your project

HTML
<!-- Interpolated Colour Stops -->
<div class="nuda-ga2-property-stops" role="img"
     aria-label="Gradient colour stops smoothly interpolating via registered custom properties"></div>
CSS
@property --ga2-stop-a {
  syntax: "<color>";
  inherits: false;
  initial-value: #e4ff54;
}

@property --ga2-stop-b {
  syntax: "<color>";
  inherits: false;
  initial-value: #a855f7;
}

.nuda-ga2-property-stops {
  width: 220px;
  height: 140px;
  border-radius: 14px;
  background: linear-gradient(135deg,var(--ga2-stop-a,#e4ff54),var(--ga2-stop-b,#a855f7));
  animation: _nuda-ga2property-stops-cycle 6s ease-in-out infinite;
}

@keyframes _nuda-ga2property-stops-cycle {
  0%,100% {
    --ga2-stop-a: #e4ff54;
    --ga2-stop-b: #a855f7;
  }
  33% {
    --ga2-stop-a: #22d3ee;
    --ga2-stop-b: #e4ff54;
  }
  66% {
    --ga2-stop-a: #fb7185;
    --ga2-stop-b: #22d3ee;
  }
}

@media (prefers-reduced-motion:reduce) {
  .nuda-ga2-property-stops {
    animation: none;
    background: linear-gradient(135deg,#e4ff54,#a855f7);
  }
}

How to use Interpolated Colour Stops

Paste the HTML where you need it and the CSS into a global stylesheet (or a <style> tag). Every class is prefixed nuda- so it never collides with Tailwind or your own styles. Tweak the CSS custom properties to match your design system.

Works in React, Vue, Svelte, Astro, Next.js, Nuxt, Laravel Blade, Django, Rails — or a single .html file. No npm install, no build step.

More animated gradients components

← Browse all NudaUI components