Modern CSS Gradient Effects
Animated, mesh, conic and text gradients built from the theme colours.
1Animated Border
A gradient border that rotates around a card or button; browsers without @property show it still. Class: fx-animated-border
Business plan
$15.78 / month
<div class="d-flex flex-wrap align-items-center justify-content-center gap-3 p-3 h-100" style="min-height:200px">
<div class="card fx-animated-border" style="width:13rem">
<div class="card-body text-center">
<div class="fs-2 text-primary">
<i class="bi bi-trophy-fill" aria-hidden="true"></i>
</div>
<h3 class="h6 mb-1">Business plan</h3>
<p class="small text-body-secondary mb-0">$15.78 / month</p>
</div>
</div>
</div>
/* CSS (already in assets/css/effects.css) */
@property --fx-animated-border-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.fx-animated-border {
border: 3px solid transparent;
background:
linear-gradient(var(--wt-surface, #fff), var(--wt-surface, #fff)) padding-box,
conic-gradient(from var(--fx-animated-border-angle), var(--wt-primary), var(--wt-accent), var(--wt-secondary), var(--wt-primary)) border-box;
animation: fx-animated-border-turn 4s linear infinite;
}
@keyframes fx-animated-border-turn { to { --fx-animated-border-angle: 360deg; } }
@media (prefers-reduced-motion: reduce) {
.fx-animated-border, .fx-animated-border::before, .fx-animated-border::after, .fx-animated-border *, .fx-animated-border *::before, .fx-animated-border *::after { animation: none !important; transition: none !important; }
}2Color Morphing
Smoothly cycles a background and its glow through the theme colours - nice for badges and CTAs. Class: fx-color-morphing
<div class="d-flex flex-wrap align-items-center justify-content-center gap-3 p-3 h-100" style="min-height:200px">
<button type="button" class="btn btn-lg border-0 rounded-pill fx-color-morphing">Reserve a spot</button>
<div class="fx-color-morphing rounded-circle d-grid fs-3" style="width:72px;height:72px;place-items:center">
<i class="bi bi-lightning-charge-fill" aria-hidden="true"></i>
</div>
</div>
/* CSS (already in assets/css/effects.css) */
.fx-color-morphing { color: var(--wt-on-primary, #fff); background-color: var(--wt-primary); animation: fx-color-morphing-morph 6s ease-in-out infinite; }
@keyframes fx-color-morphing-morph {
0%, 100% { background-color: var(--wt-primary); box-shadow: 0 10px 24px -10px rgba(var(--wt-primary-rgb), .8); }
33% { background-color: var(--wt-accent); box-shadow: 0 10px 24px -10px rgba(var(--wt-accent-rgb), .8); }
66% { background-color: var(--wt-secondary); box-shadow: 0 10px 24px -10px rgba(var(--wt-secondary-rgb), .8); }
}
@media (prefers-reduced-motion: reduce) {
.fx-color-morphing, .fx-color-morphing::before, .fx-color-morphing::after, .fx-color-morphing *, .fx-color-morphing *::before, .fx-color-morphing *::after { animation: none !important; transition: none !important; }
}