BackgroundsFree

Mesh Gradient

Six CSS-only radial gradients that slowly drift across a dark surface and blend into an organic color wash — no JavaScript required.

CSSGradientOrganic
Mesh
Hover or click the scene to interact

This effect is free — the Backgrounds category contains 50 effects total, including 6 free. Effect.Labs has 811 vanilla effects. Explore the category →

Usage examples

Next-generation developer platform

Build smarter products, faster than ever
plus vite que jamais

An open platform combining AI, automation and real-time analytics — no lock-in.

① Dark-mode home page — full-screen hero backdrop

WhenA SaaS app, open-source library, or creative portfolio needs an animated backdrop covering the full above-the-fold area.
WhyThe six halos reach every corner of the viewport and their slow drift (20 s) brings the page to life without competing with the content. A lightweight scrim is all that's needed to keep text overlays readable across any zone of the gradient.
SettingsDuration 30 s for cinematic drift; brand-matched colors (e.g. dark blue + deep violet + cyan); transparent 45% to tighten the halos and accentuate the dark intersections.
Who we are

We craft digital experiences
that leave a mark
digitales qui marquent

A creative studio at the crossroads of design and technology, based in Paris since 2017.

80+ Projects
7 Years
24 Clients
A
M
C
Meet the team →

② Full-screen 'About' section — creative studio

WhenA design studio, digital agency, or consultancy opens its 'About' page with a large dark zone beneath team portraits, values, and key figures.
WhyAcross a full-screen surface, the six halos reach every quadrant and their crossing paths embody creative identity better than any static image. The slow drift (25 s) brings the page to life without ever competing with the content above it.
SettingsDuration 25 s for movement invisible while reading; default palette (indigo + violet + cyan); transparent 50% for wide washes that blend naturally across the full surface.

③ Sign-in page — dark-mode SaaS app

WhenA full-screen authentication page needs a premium atmosphere without loading images or libraries — the mesh gradient is the only backdrop, declared in pure CSS.
WhyThe organic color blend replaces the usual hero image while staying pure CSS (zero network request, zero JS). A login form centered on an animated background signals quality and craftsmanship that flat colors or simple gradients cannot match.
SettingsDuration 20 s (default); narrow palette (indigo + violet + rose); transparent 45% for more defined halos that accentuate the dark zones around the form.

How it works

The background is built with a single background property stacking six radial-gradient() layers, each defined by an absolute position (at x% y%): every halo starts with a saturated color at its center and fades to transparent over 50% of the container. The base color rgb(10, 10, 15), placed last in the shorthand, acts as the scene backdrop — it shows through wherever all gradients are fully transparent.

The animation relies on @keyframes meshMove, which animates the background-position of all six layers independently. At 0% and 100%, the halos sit at their starting positions (0% 0%, 100% 0%…); at 50%, they cross to opposite positions (100% 100%, 0% 100%…). This crossover sends each color center toward the opposite corner and back, creating a breathing effect over a 20-second ease cycle.

The visual blending is handled entirely by native CSS compositing: gradient layers stack on top of each other, transparent zones reveal the layers below and the base color. No canvas, no JS computation — the browser handles position interpolation via its GPU renderer, keeping the animation lightweight even on large surfaces.

Accessibility

  • prefers-reduced-motion: absent from the code. The CSS animation runs unconditionally regardless of the system preference. Add @media (prefers-reduced-motion: reduce) { .demo-preview.bg-mesh { animation: none; } } before deploying.
  • The .bg-mesh container has no role or aria-label — it is purely decorative. Text content placed over it must live in a sibling or child element to remain accessible to screen readers.
  • The .bg-label ('Mesh' text, centered) is absolutely positioned with a semi-transparent black text-shadow. No WCAG contrast ratio is guaranteed: the background is dynamic and shifts hue continuously. Replace or hide it in production.
  • No keyboard or pointer interaction is defined — the effect is 100% passive and captures no events. Accessibility depends entirely on the content placed on top of it.

Browser compatibility

Requires CSS animations (@keyframes) and multi-layer background shorthand with position — supported in all modern browsers since 2013.

Chrome 88+✓ Full
Firefox 87+✓ Full
Safari 14+✓ Full
Edge 88+✓ Full
Mobile iOS✓ Full
Android Chrome✓ Full

Without <code>@keyframes</code> support (IE 9 and older): the six gradients render statically over the base color — consistent look, no animation. On IE 8, the multi-layer <code>background</code> shorthand is ignored and only the base color <code>rgb(10, 10, 15)</code> displays.

The code

Copy the three blocks into your page. No dependencies.

HTML
<div class="bg-mesh" style="width:100%;min-height:300px;">
  <span class="bg-label">Mesh</span>
</div>
CSS
@keyframes meshMove  {
   
  0%, 100%  {
   background-position: 0% 0%, 100% 0%, 0% 100%, 100% 50%, 0% 100%, 100% 100%;
   }
  50%  {
   background-position: 100% 100%, 0% 100%, 100% 0%, 0% 50%, 100% 0%, 0% 0%;
   }
}

.bg-label  {
   position: absolute;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%);
   font-weight: 700;
   font-size: 1.5rem;
   color: white;
   text-shadow: rgba(0, 0, 0, 0.5) 0px 2px 10px;
   z-index: 10;
   }
JavaScript (fx-0051)
// Effet CSS pur — pas de JavaScript nécessaire

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
radial-gradient() colors (in the CSS) indigo · fuchsia · cyan · violet · indigo · rose Replace the 6 rgb() values inside the radial-gradient() declarations. Each gradient targets a distinct zone — edit them independently to match your brand colors.
animation-duration (20s) 20s Duration of one full cycle in the animation property. 10 s = noticeable movement; 40 s = very slow, near-imperceptible drift. Change only this value in the animation shorthand.
animation-timing-function (ease) ease Replace ease with linear for constant speed or cubic-bezier(0.45,0,0.55,1) for a more pronounced breathing rhythm at the extremes.
Base color (rgb(10, 10, 15)) rgb(10, 10, 15) Last value in the background shorthand: the tint visible at transparent intersections. Switch to #fff for a light theme — the gradients behave very differently over a white base (pastel tones recommended).
Gradient radius (transparent 50%) 50% The 50% value in each radial-gradient(…, transparent 50%) controls halo size. 30% = distinct, high-contrast halos; 70% = wide washes that nearly fully blend into each other.
animation-play-state running Set to paused via JS (el.style.animationPlayState = 'paused') to cleanly freeze the animation without removing it — useful for a Pause button or to honor prefers-reduced-motion from JavaScript.

FAQ

Does Mesh Gradient require JavaScript?

No — it's pure CSS. Copy the HTML block and the CSS and you're done. No dependencies, no bundle. Compatible with any framework (React, Vue, Svelte, Angular): wrap the <div class="bg-mesh"> in a component and the styles apply immediately with no configuration.

How do I adapt the effect for a light theme?

Replace the base color rgb(10, 10, 15) with #ffffff (or a light tint of your choice) at the end of the background shorthand, then use pastel gradient colors (rgba() with high transparency or low-saturation HSL). Over a white base, transparent gradients blend softly into white — the result looks very different from dark mode.

Can text be legibly overlaid on the animated background?

Yes, with a scrim between the background and the text: an absolutely positioned <div> (inset: 0) with background: linear-gradient(to bottom, rgba(0,0,0,0.45), rgba(0,0,0,0.25)) is enough. White text then achieves a reliable WCAG AA contrast ratio even as the gradients shift to lighter zones.