CSS mesh gradient generator

Drag colour points around to build soft, flowing mesh gradients. The result is pure CSS, made of layered radial gradients, so it’s sharp at any size and weighs almost nothing.

Free · no sign-up · copy and paste

Controls

CSS

How to use the mesh gradient generator

  1. Drag the colour points. Each dot is a colour in the mesh. Drag it anywhere on the preview, or select it and use the arrow keys for fine adjustments.
  2. Choose colours. Set the base colour that shows through behind everything, then pick a colour for each point. Two to four points look elegant; five or six create a busier, more painterly effect.
  3. Set the softness. Softness controls how far each colour spreads before fading out. Higher values blend everything together; lower values keep distinct pools of colour.
  4. Add grain and copy. Tick Add subtle grain for a printed texture, then copy the CSS into your stylesheet.

What is a mesh gradient?

In design apps, a mesh gradient blends colours across a grid of points, creating smooth, organic transitions that a straight linear or radial gradient can’t. They’re popular for hero backgrounds, app splash screens and brand artwork.

How it works in CSS

CSS has no mesh gradient function, but layering several radial-gradient() backgrounds, each fading from a colour to transparent, gives a very similar result. Each layer is positioned with at x% y%, so the gradient scales with the element and stays crisp on any screen, with no image to download.

Making it look good

Pick colours that sit near each other on the colour wheel, plus one contrasting accent. Keep a darker base colour for depth. If you place text on top, check its contrast against both the lightest and darkest parts of the gradient.

Using it in WordPress, Elementor, Divi, Bricks and Breakdance

Choose your page builder from Paste into, above the code, and Refract rewrites the CSS for it. Elementor Pro and Divi 5 use the selector keyword, Bricks uses %root% and Breakdance uses %%SELECTOR%%, so the effect only applies to the element you paste it into. Elementor’s newer V4 atomic elements (Heading, Image, Button, Div block) work differently: their Custom CSS sits inside the element’s own style, so Refract splits the code into a part for the element and a part for your site-wide CSS. For the WordPress block editor, free Elementor and Divi 4, you add a CSS class to the element and paste the CSS into your site’s custom CSS. The numbered steps under the code show exactly where to click, and Refract remembers your builder for every tool.

Frequently asked questions

Does this work in every browser?

Yes. Layered radial gradients are supported in every modern browser.

Can I animate a mesh gradient?

You can animate the positions with CSS custom properties registered with @property, but large animated gradients use a lot of processing power. A slow, subtle movement is best.

How do I avoid banding?

Smooth gradients over large areas can show faint steps of colour on some screens. Adding a little grain breaks those up.

Can I use this in Elementor, Divi or Bricks?

Yes. Choose your page builder under Paste into, above the code. The CSS is rewritten for that builder, and the steps underneath tell you exactly where to paste it. WordPress’s block editor and Breakdance are supported too.