Options
Make Moey yours without touching its files: pick a brand color with one attribute, and change fonts, sizes, corners, spacing and motion with CSS variables.
Brand color
Moey's default color is black (white in dark mode). data-mo-brand on <html> makes any palette color the default instead — every default button, link, switch, checkbox, focus ring and progress bar follows. Try it: it changes this whole page.
<html lang="en" data-mo-brand="blue">
Any of the 14 palette colors works: blue indigo purple pink red orange amber yellow lime green teal cyan brown gray — or tuxedo for the default black. Your own color (not in the palette) needs a build — see below.
CSS variables
Everything Moey draws comes from a variable. Set them in your own stylesheet (after Moey's) — on :root for the whole site, or on any element for just that part.
:root {
--mo-font-sans: "Your Font", system-ui, sans-serif; /* text */
--mo-font-size: 1rem; /* base size: 15px by default, made for apps */
--mo-radius-control: .375rem; /* buttons, inputs */
--mo-radius-card: .75rem; /* cards, widgets */
--mo-surface-border-width: 1px; /* a border on cards and panels (borderless by default) */
--mo-shadow-strength: 2; /* stronger shadows on menus and dialogs */
--mo-container-max: 72rem; /* widest a .container gets */
--mo-gutter: 2rem; /* space between grid columns */
--mo-duration: .2s; /* speed of hovers and small transitions */
}
| Variable | Default | What it changes |
|---|---|---|
--mo-font-sans · --mo-font-mono | Inter · JetBrains Mono | the fonts (both self-hosted, no Google Fonts) |
--mo-font-size | .9375rem (15px) | the base text size |
--mo-font-weight-medium · --mo-heading-weight | 500 · 600 | how bold labels and headings are |
--mo-radius-control · --mo-radius-card · --mo-radius-overlay · --mo-radius-dialog | 10 · 16 · 14 · 20px | corners — or use a shape: shape-sharp / shape-round |
--mo-surface-border-width | 0px | borders on cards, panels, alerts, badges |
--mo-border-color | soft gray | lines and input borders |
--mo-shadow-strength | 1 | how dark shadows are (0 = none) |
--mo-bg-body · --mo-bg-surface · --mo-fg-body | gray page · white cards · ink | the page, cards and text (each follows light / dark mode) |
--mo-container-max · --mo-container-padding · --mo-gutter | 80rem · 1rem · 1.5rem | page width and grid spacing |
--mo-duration · --mo-ease | .15s · soft ease-out | small transitions |
--mo-focus-ring-width | 3px | keyboard focus rings |
--mo-z-menu · --mo-z-sticky · --mo-z-fixed · --mo-z-toast · --mo-z-tooltip | 1000 … 1100 | layers |
Each component has its own variables too — see Components.
Build options
For changes that create new classes, Moey has a build (node build.mjs, no other tools needed). The settings sit at the top of build.mjs:
| Setting | What it is |
|---|---|
PALETTE | the colors, as [lightness, chroma, hue] — add your brand color here and it gets all 12 shades, every strength and every component class |
DEFAULT_THEME | which color is the default (tuxedo = black) |
BREAKPOINTS | sm 576 · md 768 · lg 1024 · xl 1280 · 2xl 1536 |
SPACE · SIZES | the spacing and size scale (number × 4px) |
GRID | columns, gutters |
// build.mjs — your own brand color, and make it the default
const PALETTE = {
…
coral: [68, .16, 32], // lightness %, chroma, hue — try oklch.com
};
const DEFAULT_THEME = 'coral';