import { ApiTable } from "@/components/api-table.tsx";
import { CustomizingYourThemeColors, ResponsiveDesign, UsingACustomValue } from "@/components/content.tsx";
import { Example } from "@/components/example.tsx";
import { Figure } from "@/components/figure.tsx";
export const title = "background-image";
export const description = "Utilities for controlling an element's background image.";
]", "background-image: ;"],
["bg-(image:)", "background-image: var();"],
["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));"],
["bg-linear-to-tl", "background-image: linear-gradient(to top left, var(--tw-gradient-stops));"],
["bg-linear-", "background-image: linear-gradient( in oklab, var(--tw-gradient-stops));"],
["-bg-linear-", "background-image: linear-gradient(- in oklab, var(--tw-gradient-stops));"],
[
"bg-linear-()",
"background-image: linear-gradient(var(--tw-gradient-stops, var()));",
],
["bg-linear-[]", "background-image: linear-gradient(var(--tw-gradient-stops, ));"],
["bg-radial", "background-image: radial-gradient(in oklab, var(--tw-gradient-stops));"],
[
"bg-radial-()",
"background-image: radial-gradient(var(--tw-gradient-stops, var()));",
],
["bg-radial-[]", "background-image: radial-gradient(var(--tw-gradient-stops, ));"],
["bg-conic-", "background-image: conic-gradient(from in oklab, var(--tw-gradient-stops));"],
["-bg-conic-", "background-image: conic-gradient(from - in oklab, var(--tw-gradient-stops));"],
["bg-conic-()", "background-image: var();"],
["bg-conic-[]", "background-image: ;"],
["from-", "--tw-gradient-from: ;"],
["from-", "--tw-gradient-from-position: ;"],
["from-()", "--tw-gradient-from: var();"],
["from-[]", "--tw-gradient-from: ;"],
["via-", "--tw-gradient-via: ;"],
["via-", "--tw-gradient-via-position: ;"],
["via-()", "--tw-gradient-via: var();"],
["via-[]", "--tw-gradient-via: ;"],
["to-", "--tw-gradient-to: ;"],
["to-", "--tw-gradient-to-position: ;"],
["to-()", "--tw-gradient-to: var();"],
["to-[]", "--tw-gradient-to: ;"],
]}
/>
## Examples
### Basic example
Use the `bg-[]` syntax to set the background image of an element:
{
}
```html
```
### Adding a linear gradient
Use utilities like `bg-linear-to-r` and `bg-linear-` with the [color stop utilities](#setting-gradient-color-stops) to add a linear gradient to an element:
{
}
```html
```
### Adding a radial gradient
Use the `bg-radial` and `bg-radial-[]` utilities with the [color stop utilities](#setting-gradient-color-stops) to add a radial gradient to an element:
{
}
```html
```
### Adding a conic gradient
Use the `bg-conic` and `bg-conic-` utilities with the [color stop utilities](#setting-gradient-color-stops) to add a conic gradient to an element:
{
}
```html
```
### Setting gradient color stops
Use utilities like `from-indigo-500`, `via-purple-500`, and `to-pink-500` to set the colors of the gradient stops:
{
}
```html
```
### Setting gradient stop positions
Use utilities like `from-10%`, `via-30%`, and `to-90%` to set more precise positions for the gradient color stops:
{
10%
30%
90%
}
```html
```
### Changing interpolation mode
Use the interpolation modifier to control the interpolation mode of a gradient:
{
srgb
hsl
oklab
oklch
longer
shorter
increasing
decreasing
}
```html
```
By default gradients are interpolated in the `oklab` color space.
### Removing background images
Use the `bg-none` utility to remove an existing background image from an element:
```html
```
### Using a custom value
### Responsive design
## Customizing your theme