Design glossaryA gradient is a smooth blend from one color to another across an area, used for backgrounds, buttons, and depth.
A gradient is a gradual transition between two or more colors. Each color in it is called a color stop, and the browser or design tool fills in everything between the stops. Gradients turn up as page backgrounds, hero overlays, buttons, charts, and logos, and they can be subtle enough to pass for a flat color or bold enough to be the centerpiece of a brand.
Types of gradient
- Linear: colors change along a straight line at any angle, such as top to bottom or 45 degrees.
- Radial: colors spread out from a center point in a circle or ellipse, useful for spotlights and glows.
- Conic: colors sweep around a center point like the hands of a clock, the basis for pie charts and color wheels in CSS.
- Mesh: design tools such as Adobe Illustrator can blend colors across a grid of points for organic, painterly gradients. CSS has no mesh gradient, so designers approximate one by layering several radial gradients or use an image.
Gradients in CSS
CSS draws gradients as images, so they need no download and stay sharp at any size:
background: linear-gradient(135deg, #5378d2, #3bffdd);
background: radial-gradient(circle at top, #ffffff, #e8eefc);
- Hard stops: placing two stops at the same position makes a sharp line, which is how stripes and split backgrounds are made.
- Repeating gradients:
repeating-linear-gradient()and its siblings tile a pattern. - Interpolation: by default, browsers blend in the sRGB color space, which can produce a dull gray middle between two strong colors such as blue and yellow. Modern browsers let you choose the space, for example
linear-gradient(in oklch, blue, yellow), for brighter, more even blends. - Gradient text:
background-clip: textwith a transparent text color fills letters with a gradient.
Gradients in WordPress
The block editor offers gradient backgrounds on blocks such as Group, Cover, and Button. Themes provide the preset gradients: block themes list them under settings.color.gradients in theme.json, and site owners can choose or edit them in the Site Editor under Styles. Defining a few brand gradients there keeps them consistent across the site instead of each page using slightly different colors.
Design tips
- Stay close on the color wheel for subtle gradients. Neighboring hues, or one hue at two lightness levels, look smooth. Opposite hues give a vivid result but risk a muddy middle unless you add a stop or change the interpolation space.
- Check text contrast across the whole gradient. White text may pass on the dark end and fail on the light end. Test both, as described under contrast.
- Watch for banding. Long, gentle gradients between similar colors can show visible steps, especially in compressed images. Adding a very light noise texture, or rendering the gradient in CSS rather than as a JPEG, usually helps.
- Use them with intent. A gradient works best in one or two places, such as the hero and a closing call to action, rather than on every element.
Source: MDN, the gradient CSS data type.