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">Beauty</span>
<h3 class="h5 fw-bold mb-2">Pieces you will reach for every day</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; }
}2Gradient Shadow
A colourful multi-tone glow under cards and images built from layered tinted shadows. Class: fx-gradient-shadow
<div class="d-flex flex-wrap align-items-center justify-content-center gap-3 p-3 h-100" style="min-height:200px">
<img src="https://images.unsplash.com/photo-1598305762558-328f599df683?auto=format&fit=crop&w=1200&h=800&q=70" alt="Photo with a colourful shadow" class="fx-gradient-shadow rounded-4 object-fit-cover" style="width:200px;height:135px">
</div>
/* CSS (already in assets/css/effects.css) */
.fx-gradient-shadow {
box-shadow: -14px 12px 30px -10px rgba(var(--wt-primary-rgb), .55), 14px 12px 30px -10px rgba(var(--wt-secondary-rgb), .55), 0 22px 36px -14px rgba(var(--wt-accent-rgb), .55);
transition: box-shadow .4s ease, transform .4s ease;
}
.fx-gradient-shadow:hover, .fx-gradient-shadow:focus-visible {
transform: translateY(-4px);
box-shadow: -20px 18px 40px -10px rgba(var(--wt-primary-rgb), .7), 20px 18px 40px -10px rgba(var(--wt-secondary-rgb), .7), 0 30px 46px -14px rgba(var(--wt-accent-rgb), .7);
}
@media (prefers-reduced-motion: reduce) {
.fx-gradient-shadow, .fx-gradient-shadow::before, .fx-gradient-shadow::after, .fx-gradient-shadow *, .fx-gradient-shadow *::before, .fx-gradient-shadow *::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
BOLD
Discover
<div class="d-flex flex-wrap align-items-center justify-content-center gap-3 p-3 h-100" style="min-height:200px">
<div class="text-center">
<div class="display-3 fw-bold lh-1 fx-text-mask">
BOLD
</div>
<div class="display-5 fw-bold lh-1 fx-text-mask" style="--fx-mask-img:initial;background-image:url(https://images.unsplash.com/photo-1601647998829-ee316a565aea?auto=format&fit=crop&w=1200&h=800&q=70)">
Discover
</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; }
}