Modern CSS Gradient Effects
Animated, mesh, conic and text gradients built from the theme colours.
1Gradient Text
Paints any heading with a slowly shifting gradient of the primary, accent and secondary colours. Class: fx-gradient-text
Join a community that cares
<div class="d-flex flex-wrap align-items-center justify-content-center gap-3 p-3 h-100" style="min-height:200px">
<h2 class="h1 fw-bold text-center mb-0 fx-gradient-text">Join a community that cares</h2>
</div>
/* CSS (already in assets/css/effects.css) */
.fx-gradient-text {
color: var(--wt-primary-ink);
background-image: linear-gradient(90deg, var(--wt-primary), var(--wt-accent), var(--wt-secondary), var(--wt-primary));
background-size: 200% auto;
-webkit-background-clip: text; background-clip: text;
-webkit-text-fill-color: transparent;
animation: fx-gradient-text-shift 6s linear infinite;
}
@keyframes fx-gradient-text-shift { to { background-position: -200% center; } }
@media (prefers-reduced-motion: reduce) {
.fx-gradient-text, .fx-gradient-text::before, .fx-gradient-text::after, .fx-gradient-text *, .fx-gradient-text *::before, .fx-gradient-text *::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">Start now</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; }
}3Gradient 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-1706806594967-44e2b31f01d0?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; }
}