Foundations
Theming
Nine looks and a hue of your own — the personality in one word, the brand in one number.
A theme is two decisions. The look is the personality: how round the containers are against the controls, whether a card is a hairline, a tonal block or a shadow, which typeface, how dense, how loud. The hue is the brand. Set both once, on the provider, and every component, chart and code block follows:
<OmarisProvider theme={{ look: 'editorial', hue: 40 }}> Leave the theme off and the app is on the stock theme — ocean blue, soft corners, hairline cards — which is what every omaris app nobody themed looks like, and why omaris init writes one and omaris audit fails without one.
Looks
Nine ship. Each is far from the others on at least three axes, so choosing any one of them is a visible decision. A look never carries a colour: pick the look for what the product is, then the hue for whose it is.
Looks
The nine looks, each drawn with its own shape, surface, typeface and density. The colour is the page's: a look never carries one, so what differs here is exactly what choosing it would change.
Plain
Hairlines, soft corners, the system face. The defaults.
Expressive
Material 3 Expressive: tonal blocks, big soft containers, pill controls, vivid colour.
Soft
Pastel and pillowy: low chroma, tinted greys, round everything, room to breathe.
Playful
Candy colour at full volume, a rounded face, big friendly shapes.
Editorial
A magazine: serif headlines, square containers, hairlines, generous margins.
Paper
Warm, quiet greys and cards that cast a shadow — a desk, not a screen.
Poster
Loud and flat: saturated tonal blocks, sharp corners, a grotesque face.
Terminal
Monospace, compact, square, nearly grey. The developer tool and the trading desk.
Glass
Liquid glass: cards, bars and menus over a still wallpaper of the theme's hues, that give under a finger.
<script lang="ts"> import { Button, Card, Chip, Text, THEME_LOOKS, THEME_DEFAULTS, THEME_PRESETS } from 'omaris'; import { resolveTheme } from '$lib/theme/resolve.js'; import type { ThemeLookName } from '$lib/theme/looks.js'; const NAMES = Object.keys(THEME_LOOKS) as ThemeLookName[]; /* `surface` is the store's default; here each card says its own, since the * store is not scoped to a tile. `tonal` is the filled card. */ const CARD = { outlined: 'outlined', tonal: 'filled', elevated: 'elevated' } as const; /* The vars a look resolves to, as inline style, so the tile's own * `rounded-shape-*`, `gap-*` and typeface read them instead of the page's. */ function vars(name: ThemeLookName) { const s = THEME_LOOKS[name].settings; const v = resolveTheme({ ...THEME_DEFAULTS, ...s }, THEME_PRESETS).vars; return [ `--roundness:${v['--roundness']}`, v['--roundness-container'] && `--roundness-container:${v['--roundness-container']}`, `--spacing:${v['--spacing']}`, v['--font-family-user'] && `--font-family-user:${v['--font-family-user']}`, `font-family:var(--font-family-user,var(--font-family-sans))` ] .filter(Boolean) .join(';'); }</script><div class="grid w-full gap-4 sm:grid-cols-2 lg:grid-cols-3"> {#each NAMES as name (name)} {@const look = THEME_LOOKS[name]} <div class="flex flex-col gap-2" style={vars(name)}> <Card variant={CARD[look.settings.surface ?? 'outlined']} size="lg" class="gap-4"> <div class="flex flex-col gap-1"> <Text variant="label-md" tone="muted" class="tracking-wide uppercase">{name}</Text> <Text as="h3" variant="title-lg">{look.label}</Text> <Text variant="body-sm" tone="muted">{look.hint}</Text> </div> <div class="flex flex-wrap items-center gap-2"> <Button size="xs">Continue</Button> <Chip size="sm" variant="tonal">Paid</Chip> <span class="h-7 min-w-16 flex-1 rounded-shape-xs border border-input"></span> </div> </Card> </div> {/each}</div> | Look | Shape | Cards | Type | Density | Colour | For |
|---|---|---|---|---|---|---|
expressive | md, containers expressive | tonal | sans | comfortable | vivid, tinted greys | Consumer apps, phone-first, anything alive |
soft | lg, containers expressive | tonal | rounded | spacious | quiet, very tinted | Wellbeing, journals, anything calm |
playful | lg, containers expressive | tonal | rounded | spacious | loud | Games, kids, fitness, food, streaks |
editorial | square, containers sharp | outlined | serif | spacious | muted | Reading, publishing, portfolios |
paper | md | elevated | system | comfortable | quiet, warm greys | Notes, bookkeeping, documents, productivity |
poster | sm, containers sharp | tonal | sans | comfortable | loud, neutral greys | Landing pages, marketplaces, brands |
terminal | square | outlined | mono | compact | nearly grey | Developer tools, trading, ops, logs |
glass | lg, containers expressive | elevated | sans | comfortable | liquid glass | Media, creative tools, deep dashboards |
plain | sm | outlined | system | comfortable | as designed | The stock theme. Not a choice |
A look expands into the ordinary settings, so anything after it overrides it:
import { theme } from 'omaris';theme.set({ look: 'editorial', radius: 'sm' }); // the editorial look with softer fieldstheme.look = 'terminal'; // the whole look, in one line Add your own through the provider, the way you add a preset:
<OmarisProvider looks={{ house: { label: 'House', hint: 'Our own', settings: { radius: 'md', shape: 'expressive', surface: 'tonal', font: 'sans', tint: 1.5 } } }} theme={{ look: 'house', hue: 32 }}> Shape: containers against controls
radius is the control radius — fields, chips, menu items, small cards. Containers — cards, dialogs, sheets, the large FAB, a hero block — follow shape:
uniform— containers followradius. What every app did before the knob.expressive— containers go to Material 3 Expressive's generous corners (about 34px on a dialog) while fields and chips keepradius. Pill buttons and big soft cards without 34px text fields.sharp— containers are square whateverradiussays. Square cards under pill buttons: the editorial and poster look.
Under the hood rounded-shape-lg, -xl and -2xl read --roundness-container ahead of --roundness; xs–md read --roundness alone. Use the large sizes on things that contain and the small ones on things that are pressed, and your own markup follows the setting too.
Surface: what a card is
surface is the Card variant when nobody says: outlined (a hairline — the shadcn look), tonal (a filled block — the Material look) or elevated (a shadow). Leave variant off a Card and it follows; set it only where one card has to differ. Your own containers follow by hand: bg-surface-container-low for tonal, border border-border for outlined, shadow-1 for elevated — one of the three, never two.
Colour
Every colour in omaris is OKLCH, expressed in terms of three knobs: an accent hue, a chroma multiplier and a tint. Both light and dark are derived from them, so changing one value re-skins the whole app — components, charts and syntax highlighting together.
Presets
Ten of them: indigo, ocean, teal, forest, amber, sunset, rose, violet, coffee, graphite. A preset is a colour and only a colour; the look decides everything else.
import { theme } from 'omaris';theme.preset = 'forest'; Or your own
The hue comes from the product: money and growth sit around 150–170, food and warmth 30–60, health and calm 180–220, night and media 260–300, anything playful 330–20. Setting a hue switches to the custom preset automatically — on the provider too, so theme={{ look: 'paper', hue: 155 }} is enough.
theme.hue = 210; // degreestheme.chroma = 0.7; // 0 is monochrome, 1 as designed, up to 1.6theme.tint = 1.4; // how far the greys lean toward the accent A tint above 1 is the cheapest signature there is: the greys lean toward the accent, so even an empty surface belongs to this product and no other.
Everything the store holds
| Setting | Values |
|---|---|
look | a look name — expands into the rows marked ◦ below |
mode | light · dark · system |
preset | a preset name, or custom |
hue | degrees, when preset is custom |
chroma ◦ | 0–1.6 |
tint ◦ | 0 is pure grey |
contrast | normal · high |
radius ◦ | none · sm · md · lg · xl · full — the control radius |
shape ◦ | uniform · expressive · sharp — containers against controls |
surface ◦ | outlined · tonal · elevated — what a Card is by default |
density ◦ | compact · comfortable · spacious |
scale | 0.8–1.25, whole-UI zoom |
fontSize | sm · md · lg · xl, independent of scale |
font ◦ | system · sans · rounded · serif · mono, or any stack |
motion | full · reduced · none |
translucent ◦ | false (default) · true — liquid glass: wallpaper, glass cards and bars, liquid presses |
Every one is a property, so bind: works:
<Slider bind:value={theme.scale} min={0.8} max={1.25} step={0.05} /> Or set several at once, and go back:
theme.set({ look: 'paper', preset: 'forest', density: 'compact' });theme.reset(); Translucency
Off by default, on under the glass look. Turn it on and the interface turns to liquid glass:
<html>wears a still wallpaper — soft pools of the theme's primary and tertiary hues and their complement — for the glass to blur.- Cards, sheets and dialogs become glass: a thin fill, the wallpaper blurred through it, a lit top edge, a faint rim and a soft drop. Navigation bars, app bars, docks and drawers take the denser glass-bar, so what scrolls under them never fights their labels.
- Popovers, menus, dropdowns and toasts stay frosted.
- Buttons, icon buttons, FABs, chips and pressable cards are liquid: press and they give, drag and they follow on a rubber band, let go and they spring back. A drag never counts as a click.
High contrast switches all of it back off, and reduced motion keeps the glass but stills the liquid.
theme.translucent = true; Your own surfaces opt in with the translucent: variant, which applies only while the setting is on. Pair the utility with its bg- token so it outranks a resting fill set in the same class list:
<div class="border bg-popover shadow-3 translucent:frosted">…</div><section class="bg-surface-container translucent:glass translucent:bg-glass">…</section><nav class="bg-surface-container translucent:glass-bar translucent:bg-glass-bar">…</nav><button use:liquid>…</button> liquid only moves inside [data-translucent], so a control can carry it in every look; { size: 'large' } is the card's sink, { glassOnly: false } moves it everywhere. data-translucent on any element, with the wallpaper utility, shows glass in a frame of its own — a preview, a demo:
<div data-translucent class="rounded-shape-xl wallpaper p-6"> <Card>…</Card></div> Light and dark
mode is what the user asked for; resolvedMode is what is actually on screen once system has been worked out.
theme.toggleMode();theme.isDark; // boolean The provider resolves this before first paint, so there is no flash of the wrong theme.
A ready-made settings screen
ThemeSettings is the whole appearance panel, already bound to the store — the looks first, then colour, shape, layout, text and motion. Drop it in a dialog and you have a themable app.
<Dialog bind:open title="Appearance"> <ThemeSettings /></Dialog> Adding a preset
<OmarisProvider presets={{ brand: { label: 'Brand', primary: 268, tertiary: 320, neutral: 280, chroma: 1.1, tint: 1 } }} theme={{ look: 'glass', preset: 'brand' }}> {@render children()}</OmarisProvider>