Tailwind Gradient Utilities Explained
Tailwind's gradient system uses three main utilities: from-{color} sets the start color, via-{color} adds an optional middle color, and to-{color} sets the end color. Combine with a direction class like bg-gradient-to-r (left to right).
Direction Class Reference
Direction classes map to CSS angles: bg-gradient-to-t = 0°, bg-gradient-to-tr = 45°, bg-gradient-to-r = 90°, bg-gradient-to-br = 135°, bg-gradient-to-b = 180°, bg-gradient-to-bl = 225°, bg-gradient-to-l = 270°, bg-gradient-to-tl = 315°.
Beyond Simple Gradients
For radial, conic, or multi-stop gradients, use Tailwind's arbitrary value syntax: bg-[radial-gradient(circle,#f093fb,#f5576c)]. In Tailwind v4, you can define gradient custom properties in your CSS and reference them in utility classes.