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="flex flex-wrap items-center justify-center gap-4 p-4 h-full" style="min-height:200px">
<div class="fx-mesh-gradient rounded-xl p-6 w-full" style="max-width:19rem">
<span class="badge text-bg-light mb-2">Panel</span>
<h3 class="h5 font-bold mb-2">Be in the room where it happens</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; }
}2Color Morphing
Smoothly cycles a background and its glow through the theme colours - nice for badges and CTAs. Class: fx-color-morphing
<div class="flex flex-wrap items-center justify-center gap-4 p-4 h-full" style="min-height:200px">
<button type="button" class="btn btn-lg border-0 rounded-full fx-color-morphing">Join the beta</button>
<div class="fx-color-morphing rounded-full grid text-2xl" 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; }
}3Text Mask
Large text that works as a window onto a moving gradient - or onto an image set with an inline background-image. Class: fx-text-mask
SHINE
Wander
<div class="flex flex-wrap items-center justify-center gap-4 p-4 h-full" style="min-height:200px">
<div class="text-center">
<div class="display-3 font-bold leading-none fx-text-mask">
SHINE
</div>
<div class="display-5 font-bold leading-none fx-text-mask" style="--fx-mask-img:initial;background-image:url(https://images.unsplash.com/photo-1770097286213-6d6fc60f4cdf?auto=format&fit=crop&w=1200&h=800&q=70)">
Wander
</div>
</div>
</div>
/* CSS (already in assets/css/effects.css) */
.fx-text-mask {
color: var(--wt-primary-ink);
background-image: var(--fx-mask-img, linear-gradient(135deg, var(--wt-primary) 0%, var(--wt-accent) 30%, var(--wt-secondary) 60%, var(--wt-primary) 100%));
background-size: cover; background-position: 0% 50%;
-webkit-background-clip: text; background-clip: text;
-webkit-text-fill-color: transparent;
animation: fx-text-mask-pan 10s ease-in-out infinite alternate;
}
.fx-text-mask:not([style*="--fx-mask-img"]) { background-size: 300% 300%; }
@keyframes fx-text-mask-pan { to { background-position: 100% 50%; } }
@media (prefers-reduced-motion: reduce) {
.fx-text-mask, .fx-text-mask::before, .fx-text-mask::after, .fx-text-mask *, .fx-text-mask *::before, .fx-text-mask *::after { animation: none !important; transition: none !important; }
}