CSS gradient generator
Pick a type, drag the colour stops and copy the gradient as Tailwind CSS 4 classes like bg-linear-135 from-[#0ea5e9] to-[#6366f1], as plain CSS, or as an @theme token. Both blend in OKLab, as Tailwind 4 does, so what you copy looks like the preview.
Ship the page this week, not next quarter
Readable text on your gradient is the real test. Switch to Plain to see the gradient alone.
Get startedbg-linear-135 from-[#0ea5e9] to-[#6366f1]Tailwind 4 blends gradients in OKLab by default; the CSS does the same, so both look alike.
Heroes and banners you can install now
6 of 91 free, no account. All of them in UI Pro.
01Hero
hero-01 · Free. Journey-planner hero: from/to card with leave-at tabs, a day-out photo card and four quick-task tiles.
Open hero-01
02Call to action
call-to-action-01 · Free. Closing panel with a very large centred title, three pill actions (call, mail, book) and the founders' faces.
Open call-to-action-01- 03
All free blocks
Every one with a live preview, filtered to the ones you can use for free first.
See them all
Questions
How do I make a gradient in CSS?
Use background-image with linear-gradient(), radial-gradient() or conic-gradient(): a direction, then two or more colour stops, each with an optional position. For example background-image: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%). Add "in oklab" after the direction to blend the colours the way Tailwind 4 does, which avoids the grey middle you often get in sRGB.
How do I make a gradient in Tailwind CSS 4?
Combine a direction class with from-, via- and to- colours: bg-linear-to-r from-sky-500 to-indigo-500. Tailwind 4 renamed bg-gradient-to-r to bg-linear-to-r, added any angle (bg-linear-45), radial (bg-radial) and conic (bg-conic) gradients, and positions like from-10% and to-90%. Hex colours go in square brackets: from-[#0ea5e9].
What does "blend in OKLab" mean?
It is the colour space the browser mixes the stops in. sRGB, the old default, runs two saturated colours through a dull grey in the middle (blue to yellow is the classic case). OKLab keeps the middle bright, which is why Tailwind 4 uses it for every gradient. Add /oklch or /srgb to the direction class to change it: bg-linear-to-r/oklch.
How do I use more than three colours in a Tailwind gradient?
Tailwind has one from, one via and one to, so for four or more stops write the gradient as an arbitrary value: bg-[linear-gradient(90deg_in_oklab,#f00_0%,#ff0_33%,#0f0_66%,#00f_100%)]. The generator does this for you, or put the gradient in @theme as --background-image-brand and use bg-brand.
How do I put text on a gradient and keep it readable?
Keep the gradient within one lightness band behind the text: all light colours under dark text, or all dark under white. Switch the preview to "As a hero" to check. A gradient from light to dark behind centred text nearly always fails contrast somewhere.
Is it free?
Yes. No sign-up, and nothing leaves your browser. The address bar holds your gradient, so you can share the link.
More free tools
- Box shadow generatorLayer box shadows on a real card, light or dark, and copy them as a Tailwind CSS 4 class, plain CSS or an @theme token. Paste a shadow to edit it.
- Favicon generatorMake a favicon from letters, an emoji, an image or SVG: live light and dark tab previews, and one zip with favicon.ico, favicon.svg, the Apple touch icon, manifest icons and the tags.
- SVG to PNG converterConvert SVG to PNG, JPG or WebP at 1× to 4× or an exact width, transparent or on a colour. Several files at once, one zip, and a warning when the SVG has no viewBox.
- PNG to WebP converterConvert PNG and JPG to WebP (or AVIF where your browser can) in your browser: quality slider, max width, size saved per file, before/after slider, zip download and the <picture> HTML.
UI Pro
Build your next site from finished blocks
Every block, page template and website theme from €199, paid once, with every update and everything we add later. Not ready? The free blocks are open to everyone.
- blocks
- 1401
- page templates
- 55
- website themes
- 29

This card is a UI Pro block: Rooilijn (call-to-action-07).