Skip to content

Color

CSS utility classes to apply colors to border, elements, svgs and text.

Class names

Background colors

ClassDescription
bg-backgroundBackground color.
bg-cardSet card color as background color.
bg-foregroundSet foreground color as background color.
bg-primarySet primary color as background color..
bg-secondarySet secondary color as background color.
bg-mutedSet muted color as background color.
bg-negativeSet negative color as background color.
bg-positiveSet positive color as background color.
bg-warningSet warning color as background color.
bg-informationSet information color as background color.
bg-sidebarSet sidebar color as background color.

bg-muted is also available with the hover: variant (hover:bg-muted) for interactive surfaces such as list rows and menu items.

Text colors

ClassDescription
text-backgroundSet background color as text color.
text-foregroundSet foreground color as text color.
text-primarySet primary color as text color.
text-primary-foregroundSet primary foreground color as text color.
text-secondarySet secondary color as text color.
text-secondary-foregroundSet secondary foreground color as text color.
text-mutedSet muted color as text color.
text-muted-foregroundSet muted foreground color as text color.
text-negativeSet negative color as text color.
text-negative-foregroundSet negative foreground color as text color.
text-positiveSet positive color as text color.
text-positive-foregroundSet positive foreground color as text color.
text-warningSet warning color as text color.
text-warning-foregroundSet warning foreground color as text color.
text-informationSet information color as text color.
text-information-foregroundSet information foreground color as text color.
text-sidebar-foregroundSet sidebar foreground color as text color.

SVG/Icon fill colors

ClassDescription
fill-noneRemoves fill (fill: none).
fill-currentSet current color as fill color.
fill-primarySet primary color as fill color.
fill-primary-foregroundSet primary foreground color as fill color.
fill-secondarySet secondary color as fill color.
fill-secondary-foregroundSet secondary foreground color as fill color.
fill-mutedSet muted color as fill color.
fill-muted-foregroundSet muted foreground color as fill color.
fill-negativeSet negative color as fill color.
fill-negative-foregroundSet negative foreground color as fill color.
fill-positiveSet positive color as fill color.
fill-positive-foregroundSet positive foreground color as fill color.
fill-warningSet warning color as fill color.
fill-warning-foregroundSet warning foreground color as fill color.
fill-informationSet information color as fill color.
fill-information-foregroundSet information foreground color as fill color.

Border colors

ClassDescription
border-borderSet the theme's default border color as border color.
border-backgroundSet background color as border color.
border-foregroundSet foreground color as border color.
border-primarySet primary color as border color.
border-primary/50Set primary color as border color with 50 opacity.
border-primary-foregroundSet primary foreground color as border color.
border-secondarySet secondary color as border color.
border-secondary-foregroundSet secondary foreground color as border color.
border-mutedSet muted color as border color.
border-muted-foregroundSet muted foreground color as border color.
border-negativeSet negative color as border color.
border-negative-foregroundSet negative foreground color as border color.
border-positiveSet positive color as border color.
border-positive-foregroundSet positive foreground color as border color.
border-warningSet warning color as border color.
border-warning-foregroundSet warning foreground color as border color.
border-informationSet information color as border color.
border-information-foregroundSet information foreground color as border color.

Standard colors

A subset of the standard color palette is available as bg-, text-, fill-, and stroke- utilities for general-purpose use. The chromatic colors are provided at the 500 step, while white and black have no step. The fill- and stroke- classes paint SVG content, such as icons or custom vector graphics.

ColorBackground classText classFill classStroke class
Whitebg-whitetext-whitefill-whitestroke-white
Blackbg-blacktext-blackfill-blackstroke-black
Redbg-red-500text-red-500fill-red-500stroke-red-500
Orangebg-orange-500text-orange-500fill-orange-500stroke-orange-500
Yellowbg-yellow-500text-yellow-500fill-yellow-500stroke-yellow-500
Greenbg-green-500text-green-500fill-green-500stroke-green-500
Tealbg-teal-500text-teal-500fill-teal-500stroke-teal-500
Bluebg-blue-500text-blue-500fill-blue-500stroke-blue-500
Indigobg-indigo-500text-indigo-500fill-indigo-500stroke-indigo-500
Purplebg-purple-500text-purple-500fill-purple-500stroke-purple-500
Pinkbg-pink-500text-pink-500fill-pink-500stroke-pink-500
Graybg-gray-500text-gray-500fill-gray-500stroke-gray-500

Examples

Standard colors

html
<p class="border bg-white p-4 text-black">white</p>
<p class="bg-black p-4 text-white">black</p>
<p class="bg-red-500 p-4 text-white">red-500</p>
<p class="bg-orange-500 p-4 text-white">orange-500</p>
<p class="bg-yellow-500 p-4 text-black">yellow-500</p>
<p class="bg-green-500 p-4 text-white">green-500</p>
<p class="bg-teal-500 p-4 text-white">teal-500</p>
<p class="bg-blue-500 p-4 text-white">blue-500</p>
<p class="bg-indigo-500 p-4 text-white">indigo-500</p>
<p class="bg-purple-500 p-4 text-white">purple-500</p>
<p class="bg-pink-500 p-4 text-white">pink-500</p>
<p class="bg-gray-500 p-4 text-white">gray-500</p>

Primary

html
<p class="bg-primary p-4 text-primary-foreground">Primary</p>
<p class="p-4 text-primary">Primary</p>
<svg x-h-icon class="size-8 bg-primary fill-primary-foreground" data-link="/harmonia/logo/harmonia-symbolic.svg" role="presentation"></svg>
<svg x-h-icon class="size-8 fill-primary" data-link="/harmonia/logo/harmonia-symbolic.svg" role="presentation"></svg>

Negative

html
<p class="bg-negative p-4 text-negative-foreground">Negative</p>
<p class="p-4 text-negative">Negative</p>
<svg x-h-icon class="size-8 bg-negative fill-negative-foreground" data-link="/harmonia/logo/harmonia-symbolic.svg" role="presentation"></svg>
<svg x-h-icon class="size-8 fill-negative" data-link="/harmonia/logo/harmonia-symbolic.svg" role="presentation"></svg>

Positive

html
<p class="bg-positive p-4 text-positive-foreground">Positive</p>
<p class="p-4 text-positive">Positive</p>
<svg x-h-icon class="size-8 bg-positive fill-positive-foreground" data-link="/harmonia/logo/harmonia-symbolic.svg" role="presentation"></svg>
<svg x-h-icon class="size-8 fill-positive" data-link="/harmonia/logo/harmonia-symbolic.svg" role="presentation"></svg>

Warning

html
<p class="bg-warning p-4 text-warning-foreground">Warning</p>
<p class="p-4 text-warning">Warning</p>
<svg x-h-icon class="size-8 bg-warning fill-warning-foreground" data-link="/harmonia/logo/harmonia-symbolic.svg" role="presentation"></svg>
<svg x-h-icon class="size-8 fill-warning" data-link="/harmonia/logo/harmonia-symbolic.svg" role="presentation"></svg>

Information

html
<p class="bg-information p-4 text-information-foreground">Information</p>
<p class="p-4 text-information">Information</p>
<svg x-h-icon class="size-8 bg-information fill-information-foreground" data-link="/harmonia/logo/harmonia-symbolic.svg" role="presentation"></svg>
<svg x-h-icon class="size-8 fill-information" data-link="/harmonia/logo/harmonia-symbolic.svg" role="presentation"></svg>

Muted

html
<p class="bg-muted p-4 text-muted-foreground">Muted</p>
<p class="p-4 text-muted">Muted</p>
<svg x-h-icon class="size-8 bg-muted fill-muted-foreground" data-link="/harmonia/logo/harmonia-symbolic.svg" role="presentation"></svg>
<svg x-h-icon class="size-8 fill-muted" data-link="/harmonia/logo/harmonia-symbolic.svg" role="presentation"></svg>
html
<p class="bg-sidebar p-4 text-sidebar-foreground">Sidebar</p>