1. Backgrounds
  2. background-image

Backgrounds

background-image

Classes for setting the background image on an element.

ClassStyles
bg-[<value>]
background-image: <value>;
bg-(image: <custom-property>)
background-image: var(<custom-property>);
bg-none
background-image: none;
bg-linear-to-t
background-image: linear-gradient(to top, var(--tw-gradient-stops));
bg-linear-to-tr
background-image: linear-gradient(to top right, var(--tw-gradient-stops));
bg-linear-to-r
background-image: linear-gradient(to right, var(--tw-gradient-stops));
bg-linear-to-br
background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
bg-linear-to-b
background-image: linear-gradient(to bottom, var(--tw-gradient-stops));
bg-linear-to-bl
background-image: linear-gradient(to bottom left, var(--tw-gradient-stops));
bg-linear-to-l
background-image: linear-gradient(to left, var(--tw-gradient-stops));

Examples

Basic example

Reach for the bg-[<value>] syntax whenever you want an image sitting behind an element.

<div class="bg-[url(/img/mountains.jpg)] ..."></div>

Adding a linear gradient

Pair utilities like bg-linear-to-r and bg-linear-<angle> along with color stop utilities to layer a linear gradient onto an element:

<div class="h-14 bg-linear-to-r from-cyan-500 to-blue-500"></div><div class="h-14 bg-linear-to-t from-sky-500 to-indigo-500"></div><div class="h-14 bg-linear-to-bl from-violet-500 to-fuchsia-500"></div><div class="h-14 bg-linear-65 from-purple-500 to-pink-500"></div>

Adding a radial gradient

Apply the bg-radial and bg-radial-[<position>] utilities along with color stop utilities to layer a radial gradient onto an element:

<div class="size-18 rounded-full bg-radial from-pink-400 from-40% to-fuchsia-700"></div><div class="size-18 rounded-full bg-radial-[at_50%_75%] from-sky-200 via-blue-400 to-indigo-900 to-90%"></div><div class="size-18 rounded-full bg-radial-[at_25%_25%] from-white to-zinc-900 to-75%"></div>

Adding a conic gradient

Apply the bg-conic and bg-conic-<angle> utilities along with color stop utilities to layer a conic gradient onto an element:

<div class="size-24 rounded-full bg-conic from-blue-600 to-sky-400 to-50%"></div><div class="size-24 rounded-full bg-conic-180 from-indigo-600 via-indigo-50 to-indigo-600"></div><div class="size-24 rounded-full bg-conic/decreasing from-violet-700 via-lime-300 to-violet-700"></div>

Setting gradient color stops

Reach for utilities like from-indigo-500, via-purple-500, and to-pink-500 to paint the color of each gradient stop:

<div class="bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 ..."></div>

Setting gradient stop positions

Reach for utilities like from-10%, via-30%, and to-90% to dial in more exact spots for the gradient color stops:

<div class="bg-gradient-to-r from-indigo-500 from-10% via-sky-500 via-30% to-emerald-500 to-90% ..."></div>

Changing interpolation mode

Apply the interpolation modifier to choose which interpolation mode a gradient blends

srgb

hsl

oklab

oklch

longer

shorter

increasing

decreasing

<div class="bg-linear-to-r/srgb from-indigo-500 to-teal-400"></div><div class="bg-linear-to-r/hsl from-indigo-500 to-teal-400"></div><div class="bg-linear-to-r/oklab from-indigo-500 to-teal-400"></div><div class="bg-linear-to-r/oklch from-indigo-500 to-teal-400"></div><div class="bg-linear-to-r/longer from-indigo-500 to-teal-400"></div><div class="bg-linear-to-r/shorter from-indigo-500 to-teal-400"></div><div class="bg-linear-to-r/increasing from-indigo-500 to-teal-400"></div><div class="bg-linear-to-r/decreasing from-indigo-500 to-teal-400"></div>

By default, every gradient is interpolated in the oklab color space.

Clearing background images

Reach for the bg-none utility to strip an existing background image off an element:

<div class="bg-none"></div>

Passing a custom value

Reach for utilities like bg-linear-[<value>] and from-[<value>] to build a gradient from a completely bespoke value:

<div class="bg-linear-[25deg,red_5%,yellow_60%,lime_90%,teal] ...">  <!-- ... --></div>

For CSS variables, you can also lean on the bg-linear-(<custom-property>) syntax:

<div class="bg-linear-(--my-gradient) ...">  <!-- ... --></div>

This is simply a shorthand for bg-linear-[var(<custom-property>)] that wires up the var() function on your behalf.

Responsive design

Add a breakpoint variant like md: in front of a background-image utility to apply it only at medium screens and up:

<div class="from-purple-400 md:from-yellow-500 ...">  <!-- ... --></div>

Read more about working with variants in variants documentation.

Customizing your theme

Reach for the --color-* theme variables to tune the color utilities across your project:

@theme {  --color-regal-blue: #243c5a; }

Now utilities such as from-regal-blue, via-regal-blue, and to-regal-blue are ready to drop into your markup:

<div class="from-regal-blue">  <!-- ... --></div>

Dig deeper into tailoring your theme over in the theme documentation.

Copyright © 2026 Breezel, Inc.·Trademark Policy