Browse documentation
Reference / Backgrounds
Background color
Fill a surface with a theme color, a transparent color, or a custom shade.
Working example
Ink
Paper
A color with an alpha suffix leaves foreground text fully opaque. It mixes visually with whatever lies below the element.
<div class="grid grid-cols-2">
<p class="bg-black p-4 text-white">Ink</p>
<p class="bg-neutral-100 p-4 text-black">Paper</p>
</div>Class reference
| Class | CSS declarations |
|---|---|
bg-black | background-color: #000; |
bg-white | background-color: #fff; |
bg-neutral-100 | background-color: oklch(0.95 0 0); |
bg-black/10 | background-color: color-mix(in srgb, #000 10%, transparent); |
bg-current | background-color: currentColor; |
bg-transparent | background-color: transparent; |
bg-[#222] | background-color: #222; |
View full generated CSS
.bg-\[\#222\] {
background-color: #222;
}
.bg-black {
background-color: #000;
}
.bg-black\/10 {
background-color: color-mix(in srgb, #000 10%, transparent);
}
.bg-current {
background-color: currentColor;
}
.bg-neutral-100 {
background-color: oklch(0.95 0 0);
}
.bg-transparent {
background-color: transparent;
}
.bg-white {
background-color: #fff;
}