This page writes a CSS gradient from two or three colour stops. Choose a linear gradient and set the angle, or switch to radial and choose an ellipse or a circle. Each stop has a colour and a percentage position, and the preview updates as you move them. The output is a short rule that uses background-image, not the background shorthand.
It covers the common case: one gradient, two or three stops, a fixed centre for radial gradients. That is enough for a hero panel, a card accent or a progress bar. Layered gradients, repeating gradients, hard colour bands and colour interpolation hints are outside its scope and need to be written by hand.
Linear gradients and the angle
A linear gradient runs along a straight line. The angle is written in degrees, with 0deg pointing up, 90deg pointing right, 180deg pointing down and 270deg pointing left. The default here is 135deg, which runs from the top-left to the bottom-right. The angle field accepts any number; the output uses it as typed, without normalising it to a 0–360 range.
Stops are written as a colour and a percentage. The start stop is at 0% by default and the end stop at 100%. A middle stop is optional and sits at its own percentage. If a position is outside 0–100 it is clamped, so the gradient always has a defined start and end.
CSS sorts stops by position before painting. The generator does the same, which means the colour you called Middle can end up after the colour you called End if you give it a larger percentage. The checklist says when this happened. The output is still valid; it just may not match the mental model behind the labels.
Radial gradients
The radial option writes radial-gradient(shape farthest-corner at 50% 50%, …). The shape is ellipse or circle, the size is fixed at farthest-corner, and the centre is fixed at the middle of the box. Those three choices keep the declaration short and predictable, but they also mean the gradient cannot be positioned off-centre or sized to a side or a fixed length here.
With an ellipse, the gradient stretches to the box's aspect ratio, so the same declaration looks different on a wide card and a tall one. A circle keeps a circular shape and may leave the corners beyond the last stop. Check the preview at the size you will ship rather than at the preview's size.
A worked example
The default settings produced a two-stop linear gradient. The first colour is the site green and the second is the paper tone, at 135 degrees.
| Type | Stops | CSS value |
|---|---|---|
| Linear, 135deg | #2f6f5e 0%, #f6f1e7 100% | linear-gradient(135deg, #2f6f5e 0%, #f6f1e7 100%) |
| Linear, 90deg, middle | #2f6f5e 0%, #ff0000 30%, #f6f1e7 80% | linear-gradient(90deg, #2f6f5e 0%, #ff0000 30%, #f6f1e7 80%) |
| Radial circle | #2f6f5e 0%, #f6f1e7 100% | radial-gradient(circle farthest-corner at 50% 50%, #2f6f5e 0%, #f6f1e7 100%) |
The third run is the one to inspect closely: a radial gradient with the same colours reads very differently from the linear version because the colour change happens in rings from the centre. The CSS length also grows from 84 to 111 characters, mostly because of the shape, size and position keywords.
When the middle stop was set to 90% and the end stop to 50%, the output put the end colour first and the middle colour last. That is correct CSS sorting, and the checklist flagged it. If the visual result surprises you, compare the percentages before changing the colours.
What the rule does and does not set
The declaration uses background-image inside a class called .gradient. Using the longhand rather than the background shorthand means it does not reset background-color, background-repeat, background-position or background-size. That is usually what you want when the gradient sits over an existing background colour.
The colours are written as six-digit hex. There is no alpha channel and no colour-mix hint, so a gradient cannot fade to transparent here. Add an eight-digit hex or an rgba() value by hand if you need that. The generator also writes no vendor prefixes; current browsers do not need them for linear or radial gradients.
Two stops at the same position create a hard edge rather than a smooth blend. The output remains valid, and that can be a deliberate technique for stripes. The page does not warn about it, so check the preview if you set both positions to 50%.
Using the gradient
Copy the rule or download it as a CSS file. Rename the class and adjust the selector to your component. If the gradient is behind text, check the contrast of the text against the lightest and darkest parts of the gradient; a single mid-gradient check can miss the failing end. The colour picker checks a solid pair, which is a useful approximation for each end.
For a layered look, such as a gradient plus a subtle noise image, write a second background-image layer and separate them with a comma. This page writes one layer only. The CSS minifier can compact the final rule once it is in your stylesheet.