Dark CSS Gradient Generator
A moody dark CSS gradient that shifts between deep slate, near-black navy and charcoal. Perfect as a dark-mode background that still has subtle depth. Copy it or tweak the stops below. 100% in your browser - copy the CSS or a Tailwind v4 export.
About the dark gradient
Dark gradients make dark-mode backgrounds feel intentional instead of flat black by adding a faint shift between very dark tones. This preset blends a deep slate, a near-black navy and a charcoal so there is quiet depth without ever getting bright. Keep the stops close in lightness so the effect stays subtle, and pair it with a light or neon accent for contrast. Copy the CSS or Tailwind v4 @theme token from the generator.
The CSS for this gradient:
background: linear-gradient(in oklch 145deg, #1e293b 0%, #0f172a 50%, #020617 100%);
Frequently Asked Questions
Blend a few very dark tones that differ slightly in lightness, such as a deep slate (#1e293b), a near-black navy (#0f172a) and an almost-black (#020617). The small shift gives depth while staying dark enough for dark mode.
Keep the stops close in lightness but let the hue drift a little, for example slate toward navy. A radial gradient with a slightly lighter center also adds a subtle glow without brightening the whole background.
Other gradient colors
Jump to a ready-made gradient and copy the CSS in one click.
From the blog
Improving Core Web Vitals: Replacing Background Images with CSS Gradients
Decorative background images cause late-discovery network bottlenecks. Learn how replacing them with native CSS gradients reduces LCP delays to zero.
Read →tailwindThe Complete Guide to Tailwind CSS v4 Gradients
Tailwind CSS v4 introduces semantic upgrades to gradient classes and native OKLCH support. Learn how to use bg-linear and CSS-first theme configurations.
Read →cssThe Physics of Muddy Gradients: Bypassing the sRGB 'Dead Zone' with OKLCH
Learn why linear interpolation across sRGB color coordinates produces muddy gray gradients, and how perceptually uniform spaces like OKLCH fix it.
Read →