Modern CSS Gradient Effects
Animated, mesh, conic and text gradients built from the theme colours.
1Mesh Gradient
Soft blobs of the theme colours blended into a slowly drifting mesh - perfect for hero panels. Class: fx-mesh-gradient
<div class="d-flex flex-wrap align-items-center justify-content-center gap-3 p-3 h-100" style="min-height:200px">
<div class="fx-mesh-gradient rounded-4 p-4 w-100" style="max-width:19rem">
<span class="badge text-bg-light mb-2">Villas</span>
<h3 class="h5 fw-bold mb-2">Smart property search, real advice</h3>
<a href="#" class="btn btn-light btn-sm">Get started</a>
</div>
</div>
/* CSS (already in assets/css/effects.css) */
.fx-mesh-gradient {
background-color: var(--wt-primary);
background-image:
radial-gradient(at 15% 20%, var(--wt-accent) 0, transparent 55%),
radial-gradient(at 85% 15%, var(--wt-secondary) 0, transparent 50%),
radial-gradient(at 75% 85%, var(--wt-accent) 0, transparent 50%),
radial-gradient(at 20% 90%, var(--wt-secondary) 0, transparent 55%);
background-size: 160% 160%;
color: var(--wt-on-primary, #fff);
animation: fx-mesh-gradient-drift 14s ease-in-out infinite alternate;
}
@keyframes fx-mesh-gradient-drift { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
@media (prefers-reduced-motion: reduce) {
.fx-mesh-gradient, .fx-mesh-gradient::before, .fx-mesh-gradient::after, .fx-mesh-gradient *, .fx-mesh-gradient *::before, .fx-mesh-gradient *::after { animation: none !important; transition: none !important; }
}2Animated Border
A gradient border that rotates around a card or button; browsers without @property show it still. Class: fx-animated-border
Business plan
$30.02 / 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">$30.02 / 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; }
}