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
$13.12 / 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">$13.12 / 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; }
}2Conic Rotation
A spinning conic gradient behind round content such as avatars, scores or loaders. Class: fx-conic-rotation
77
<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-conic-rotation">
<img src="../assets/img/avatar-8.svg" alt="Profile with a spinning ring" class="object-fit-cover" style="width:96px;height:96px">
</div>
<div class="fx-conic-rotation">
<div class="bg-body d-grid fw-bold fs-4" style="width:96px;height:96px;place-items:center">
77
</div>
</div>
</div>
/* CSS (already in assets/css/effects.css) */
.fx-conic-rotation { position: relative; isolation: isolate; overflow: hidden; border-radius: 50%; padding: 5px; }
.fx-conic-rotation::before {
content: ""; position: absolute; inset: -30%; z-index: -1;
background: conic-gradient(var(--wt-primary), var(--wt-accent), var(--wt-secondary), var(--wt-primary));
animation: fx-conic-rotation-spin 3s linear infinite;
}
.fx-conic-rotation > * { display: block; border-radius: 50%; }
@keyframes fx-conic-rotation-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
.fx-conic-rotation, .fx-conic-rotation::before, .fx-conic-rotation::after, .fx-conic-rotation *, .fx-conic-rotation *::before, .fx-conic-rotation *::after { animation: none !important; transition: none !important; }
}