Theme
Color any component by its color name: theme-blue, theme-green, theme-red… — one for each of the 14 palette colors, plus theme-light, theme-dark and theme-inverse. With no class (or theme-default) it's Moey's own color, tuxedo: black on light pages, white on dark ones.
No class means the default color (blue, unless you change it). Every theme provides the same roles. A .theme-* class sets the current theme on an element, and every component reads only --mo-theme-<role>. That's why one class like .theme-red can recolor any component — buttons, alerts, badges — with no extra CSS.
Using a theme
<span class="chip chip-red chip-subtle">…</span>
.chip {
color: var(--mo-theme-fg-emphasis);
background: var(--mo-theme-bg-subtle);
/* no border — flat by default */
}
Roles
| Role | Use it for |
|---|
Light colors stay readable
Yellow, amber, lime, orange, teal and cyan are light, so their fills get dark text and their text shade is a step darker — without you doing anything.
Back to the default inside a color
theme-default resets to the default color — for example a normal button inside a red card.
<div class="card theme-red">
…
<button class="btn btn-default">Contact support</button>
</div>
One class, every component
Put a theme on a container and everything inside follows: a strength without a color — btn-vivid, badge-subtle — takes the area's color.
<div class="card theme-green">
<span class="badge badge-subtle">…</span>
<progress class="progress" value="60" max="100"></progress>
<button class="btn btn-vivid">…</button> <!-- a strength without a color takes the area's color -->
</div>
Painted areas
Add a strength to a theme — .theme-teal-soft — and the element gets that color as its background, with everything inside made readable on it: text, muted text, lines, neutral buttons, and accents like progress bars, switches and checkboxes (they switch to the text color, with the area's color on top). For heroes, banners, sidebars, highlighted rows… anything.
<section class="theme-teal-soft">…</section> <!-- -subtle · -soft · -fill · -solid · -vivid · -deep -->
<aside class="theme-indigo-deep">…</aside>
Plain .theme-teal (no strength) only colors what's inside — it doesn't paint a background. -fill is the default look, like .card-teal. Every pair is checked by the build: text at least 4.5:1, accents at least 3:1, in light and dark mode.
Moey Pro is here
Reports, roles and unlimited stores — free for 14 days.
<div class="theme-indigo-deep">
<span class="badge badge-subtle">New</span>
<h3>Moey Pro is here</h3>
<button class="btn btn-subtle">Start free trial</button>
</div>
Every color, every strength
The default (Moey's tuxedo — black, white in dark mode), the 14 palette colors and inverse, as painted areas — .theme-<color>-subtle to -deep — with text, muted text, a badge, a progress bar, a switch, a checkbox and a strong button in each. Switch between light and dark mode at the top to see both.
Use the roles in your own CSS
Read --mo-theme-* and your component works with every theme for free.
<style>
.order-status {
background: var(--mo-theme-bg-subtle);
color: var(--mo-theme-fg-emphasis);
}
.order-status::before { /* the dot */
content: "";
width: .5rem;
height: .5rem;
border-radius: 50%;
background: var(--mo-theme-base);
}
</style>
<span class="order-status theme-red inline-flex items-center gap-1.5 py-1 px-3 rounded-pill text-sm font-medium">Failed</span>
Change the default color
Moey's default is its own brand color, tuxedo — black and white, like a tuxedo cat: every btn-default, link, focus ring, switch and progress bar is black in light mode and white in dark mode. It's a pure neutral (gray has a slight blue tint; theme-dark stays dark in both modes). It has 12 shades (--mo-tuxedo-25 … -950) and all the strengths, but it isn't one of the palette colors: it's simply what "default" is. One line in build.mjs rebrands the whole app:
const DEFAULT_THEME = 'purple'; // any palette color
// or your own brand color, with its 12 shades and strengths generated for you:
const BRAND = { mint: [72, 0.12, 165] }; // OKLCH: lightness %, chroma, hue
const DEFAULT_THEME = 'mint';
To change a color itself, change its base in PALETTE (see Color) — its theme, text and shade classes all follow.