A mesh gradient in Adobe Illustrator is created by converting a filled object to a mesh, then adding, moving, and recoloring mesh points to shape the color transitions.
That native workflow gives you editable shading for artwork, but it does not generate responsive CSS for a web page. If the Illustrator design is going online, treat the native mesh as the visual reference and rebuild the background separately rather than assuming an exported artwork will scale like a CSS gradient.
The Mesh Gradient Generator fits only that web hand-off. You recreate a selected palette with four radial color fields over a base color and copy the resulting CSS. It does not import an Illustrator file, inspect mesh points, or reproduce the native gradient exactly.

Choose the right deliverable
Decide whether the gradient is artwork that needs editable vector detail or a background that must adapt to a web component. These workflows can share a palette, but they do not produce interchangeable output.
| Approach | Color structure | Geometry | Best suited for |
|---|---|---|---|
| Illustrator gradient mesh | Colors assigned to editable mesh points | Irregular transitions controlled by point placement | Illustration, dimensional shading, and vector artwork |
| Layered CSS radial gradients | Four mesh colors over one base color | Four fixed circular fields that scale with an element | Responsive web sections, cards, and backgrounds |
If the design only needs a straight color transition, the linear-gradient workflow in Adobe Illustrator is simpler. Use a mesh when irregular local color changes are important, and use layered CSS when responsive browser delivery matters more than matching every Illustrator mesh point.
Create the mesh in Illustrator
Work with a filled vector object so the mesh follows a shape rather than a rectangular background.
- Draw or select a closed vector shape. A simple silhouette is easier to refine than a detailed illustration because each added mesh point affects the surrounding color transition.
- Select the object and choose Object > Gradient Mesh. Illustrator converts the filled object into an editable gradient mesh with a starting arrangement of points.
- Choose the Gradient Mesh tool from the tools panel. Click inside the shape to add a mesh point, or select an existing point to adjust the current arrangement.
- Position the points deliberately. Drag a point toward the area where you want its color to dominate, and move points farther apart where a broader transition is needed.
- Recolor the points individually. Select one or more points with the Gradient Mesh tool, then choose their color from the Swatches panel or the Color panel. Each point influences the blending around it.
- Add more points only where the transition needs control. A crowded area can create a tighter highlight or shadow, while a sparse area produces a smoother, broader blend.
- Refine the result at a high zoom level. Check the edges, overlapping colors, and areas where neighboring points create an unexpected band. Remove or reposition points that make the transition look harsh.
- Save the editable Illustrator artwork. If the destination requires a raster or vector export, export that artwork as needed, but remember that the exported file is not automatically a responsive CSS background.
For a web hand-off, record a representative palette rather than trying to serialize every mesh point. The CSS workflow supports four mesh colors and one base color, so choose those five values deliberately.
Control transitions with mesh density
Mesh points act as local color anchors. Their distance from one another determines how quickly one color gives way to the next, while their position determines where a highlight, shadow, or mixed region appears.
- Use fewer points for broad, uncomplicated color transitions across a large shape.
- Group points closely around focal areas that need a rapid or detailed color change.
- Vary point placement to create irregular transitions that cannot be reproduced by evenly spaced controls alone.
- Keep the overall arrangement consistent with the shape's lighting or depth so the mesh reinforces the design rather than obscuring it.
When selecting colors for CSS, map the native mesh to four representative mesh colors and a base color. The approximation will preserve the palette's general direction, but it cannot duplicate the arbitrary point layout or every nuanced blend in the Illustrator artwork.
Translate the Illustrator palette into CSS
Use the generator after you have selected the five CSS colors. It builds standard CSS rather than importing, parsing, or uploading the Illustrator document.
- Open the Mesh Gradient Generator and choose four mesh colors plus one base background color. Every color must use the validated six-digit hexadecimal format.
- Adjust the fade spread with the integer control from 10% through 90%. Watch the live CSS preview as the selected color expands from each circle's center toward its transparent endpoint.
- Inspect the preview at the size and foreground content you plan to use. The preview uses the same declarations shown in the output, so it is a useful check for color placement and fade behavior.
- Copy the complete background-color and background-image declarations. The output includes all four radial-gradient layers and the base color, so there is no missing layer to reconstruct by hand.
- Paste the declarations into a class, custom-property workflow, CSS module, or style sheet. Add size, repeat, attachment, clipping, or animation rules separately only when the design actually requires them.
- Test contrast, paint cost, and cross-browser rendering in the real component before shipping. The generated background scales with its element without adding an image request.
The result uses standard radial-gradient syntax. You can consult MDN's radial-gradient reference or the W3C CSS Images radial-gradient specification for the underlying syntax.
Know what the CSS approximation includes
Each selected color becomes one circular radial-gradient layer. The centers are fixed near the corners, and the first layer listed in the CSS is closest to the viewer.
| CSS paint order | Circle center | Layer position |
|---|---|---|
| 1 | 15% 20% | Upper-left focal area |
| 2 | 85% 15% | Upper-right focal area |
| 3 | 20% 85% | Lower-left focal area |
| 4 | 80% 80% | Lower-right focal area |
- A small fade spread produces compact color islands with more base color visible between them.
- A larger fade spread carries each color across more of the element and can create broader, softer mixed regions.
- The spread is one shared integer setting from 10% through 90%; it is not a blur radius, perceptual interpolation setting, or physical softness control.
The base color fills regions where all four layers are transparent and provides a predictable fallback if a layer does not cover the entire box. The tool creates no noise field or true mathematical mesh surface. Browser interpolation, display profiles, GPUs, color spaces, screenshots, and exported PDFs can also produce small visual differences.
Test accessibility, rendering, and performance
Check text across the whole background
A mesh-style background can contain both bright and dark regions, so a foreground color that works in the center may fail elsewhere. The generator does not calculate WCAG contrast because the background changes continuously by position.
- Test headings, body copy, links, focus indicators, and controls at their actual sizes and locations.
- Put a translucent surface behind long text or use a simpler solid section when the gradient competes with reading.
- Check forced-colors, high-contrast, reduced-motion, and print styles rather than assuming the screen preview covers every mode.
Inspect the real target environment
Although the CSS is standards-based, identical colors are not guaranteed across browsers, GPUs, color spaces, screenshots, and PDFs. Open the finished component in the browsers and devices you support, and compare both large and narrow layouts.
Measure the cost of motion
Layered gradients are usually lightweight, but large animated backgrounds or frequent style changes can increase paint cost and power use. Prefer a static background for normal page sections. If positions or colors animate, measure representative mobile hardware and honor reduced-motion preferences. Avoid huge offscreen elements and excessive filter effects.
For a design system, move approved colors into named tokens, document the intended foreground treatment, and add visual regression coverage at the component sizes you ship. The generator performs its calculations and copying in the current tab, and no palette, CSS, preview, or screenshot is uploaded or saved.