Background
Background colors for any element. The everyday ones follow light and dark mode on their own, so nothing needs a dark-mode version.
Surfaces
The layers an app is built from: the page, cards on it, overlays above them, and neutral wells inside a card.
<div class="bg-surface">…</div> <!-- a card -->
<div class="bg-1">…</div> <!-- a well inside a card: bg-1 · bg-2 · bg-3 -->
<div class="bg-inverse">…</div> <!-- dark in light mode, light in dark mode; text flips too -->
bg-1 to bg-3 are meant for inside a card: in light mode the page itself is close to bg-2.
A page, a card, a well, a menu
How the surfaces stack in a real screen: the page (bg-body), a card on it (bg-surface), a well inside the card (bg-1), and a menu floating above everything (bg-raised). Switch to dark mode to see them stay in order.
<div class="bg-body rounded-lg p-4 space-y-3">
<div class="text-xs text-muted uppercase tracking-wide font-semibold">bg-body — the page</div>
<div class="bg-surface rounded-lg p-4">
<div class="flex items-center justify-between gap-3">
<div>
<div class="text-sm text-muted">bg-surface — a card</div>
<div class="text-2xl font-bold">$48,210</div>
</div>
<div class="relative">
<button class="btn btn-sm">Export</button>
<div class="absolute end-0 top-full mt-2 bg-raised shadow-overlay rounded-lg p-2 w-48 z-10 text-sm">
<div class="px-2 py-1.5">bg-raised — a menu</div>
<div class="px-2 py-1.5 text-muted">Floats above the card</div>
</div>
</div>
</div>
<div class="bg-1 rounded p-3 mt-4 text-sm">bg-1 — a well inside the card, for a note or a code block</div>
</div>
</div>
Color tints
A soft tint of each color — pale in light mode, deep in dark mode. Normal text stays readable on every one.
<div class="bg-green">…</div>
<div class="bg-default">…</div> <!-- the brand color: black in Moey, yours if you change it -->
Strong colors
For a strong background, paint the area instead — theme-<color>-<strength> sets the background and fixes the text, links, buttons and switches inside so they stay readable. See Painted areas.
$1,240.00 from Ana Kim
Everything in one place
api-2 stopped answering
<div class="grid-auto grid-min-48 gap-3">
<div class="theme-green-solid py-3 px-4 rounded-lg text-sm">
<b>Payment received</b>
<br>
$1,240.00 from Ana Kim
</div>
<div class="theme-indigo-vivid py-3 px-4 rounded-lg text-sm">
<b>Moey Pro</b>
<br>
Everything in one place
</div>
<div class="theme-red-deep py-3 px-4 rounded-lg text-sm">
<b>Server down</b>
<br>
api-2 stopped answering
</div>
</div>
Exact shades
The same color in both modes: bg-<color>-<shade>, from 25 to 950 — see Colors. Plus bg-white, bg-black and bg-transparent.
<div class="flex flex-wrap gap-2">
<div class="bg-blue-100 text-blue-900 py-3 px-4 rounded-lg text-sm">bg-blue-100</div>
<div class="bg-blue-700 text-white py-3 px-4 rounded-lg text-sm">bg-blue-700</div>
<div class="bg-blue-900 text-blue-50 py-3 px-4 rounded-lg text-sm">bg-blue-900</div>
</div>
Frosted glass
bg-blur lets the page show through, blurred — for sticky headers and toolbars that float over content. Scroll the box. Browsers without blur get a solid background.
<header class="bg-blur sticky top-0">…</header>
| Class / attribute | What it does |
|---|---|
.bg-body · .bg-surface · .bg-raised | The page · a card · an overlay (menus, dialogs) |
.bg-1 · .bg-2 · .bg-3 | Neutral wells, lightest to strongest (inside a card) |
.bg-inverse | Ink background with paper text — flips with the mode |
.bg-<color> · .bg-default | A soft tint that follows light / dark mode |
.theme-<color>-<strength> | A strong color with readable contents (Theme) |
.bg-<color>-<25…950> · .bg-white · .bg-black · .bg-transparent | Exact colors, the same in both modes |
.bg-blur | Frosted glass (add .bg-surface for a card-colored glass) |