Theming
One small config sets the brand and the corners for every component.
How theming works
Satin's tokens come in three layers. Primitives are raw colours and sizes. Semantic tokens give them a job, like action/primary-bg or text/muted, once for Light and once for Dark. Components only ever read semantic tokens, never a raw value.
So a theme doesn't touch components at all. It repoints a few primitives and scales, and everything that reads them follows: buttons, focus rings, checkboxes, tones, charts. Try it with the customizer at the bottom of the page; every sample here reads the same variables.
Brand
One colour becomes the whole brand ramp. Each step keeps the lightness of Satin's own ramp, takes your hue and scales its chroma in OKLCH, so tints, borders and soft tones land where they did. The fills a button is painted with move to your colour's lightness, and the text on them turns dark when white would read under 4.5:1.
- 50
- 200
- 300
- 500
- 600
- 700
- 900
- 950
Corners
One number scales every corner token: 0 is square, 1 is Satin's own, 1.5 is softer. Pill-shaped controls follow it too, one step per choice: square at 0, 6px at 0.5, 12px at 1 and a full pill only at 1.5. Circles, like avatars and status dots, stay round.
radius-xsradius-smradius-mdradius-lgradius-xlradius-2xl
Type
Type isn't part of a theme: it stays the same whatever brand and corners you pick. The body is 14px. Compact controls, like badges, chips, small buttons and small fields, use 13px so the interface stays light, and so do field labels; field values, checkboxes and radios keep 14px. Content text has its own scale above the body for prose and headings. Weights sit a touch off the usual steps on Geist Variable: regular 420, medium 510, semibold 590.
UI scaleControls
- Aa 11
text-2xsFine print, counters - Aa 12
text-xsCaptions, keycaps, axis labels - Aa 13
text-smBadges, chips, buttons, menus, tabs, field labels, small fields - Aa 14
text-baseField values, checkboxes, card titles
Content scaleWhat people read
- Aa 14
text-bodyMessages, descriptions, table cells - Aa 14
text-body-lgLong-form prose, with more leading - Aa 16
text-titleSection headings - Aa 20
text-headingLarge headings, figures - Aa 24
text-displayPage and hero titles
Use it in your app
The theme is a short stylesheet of variables. Export it from the customizer and load it after Satin's styles, or build it in code from the same two values with themeCss from @uisatin/ui/theme, which a Server Component can call.
import '@uisatin/ui/styles.css'
import './satin-theme.css' // from the customizer: Export → Download// @uisatin/ui/theme is plain functions, safe in a Server Component.
import { themeCss } from '@uisatin/ui/theme'
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
<style>{themeCss({ brand: '#E5533D', radius: 1.5 })}</style>
</head>
<body>{children}</body>
</html>
)
}To change one token rather than the brand, set its variable after Satin's styles. In the package and the registry every variable is prefixed, --sa-bg-card, --sa-text-muted, so it never meets your own; the token pages below list them. Code that read the unprefixed names from before 0.6 renames them to --sa-*; @uisatin/ui/compat.css, which aliased them in 0.6, is removed in 0.7.
/* After @uisatin/ui/styles.css. Every Satin variable is --sa-*. */
:root {
--sa-action-primary-bg: #0f766e;
}
.dark,
[data-theme='dark'] {
--sa-action-primary-bg: #2dd4bf;
}Tokens
Every semantic colour by group, in Light and Dark, straight from tokens.json.
- Background9 tokensSurfaces from the canvas up to popovers, and their hover and selected fills.
- Text7 tokensCopy on every surface, from default to placeholder and on solid fills.
- Border5 tokensHairlines, dividers, field outlines and the focus ring.
- Action22 tokensButtons and other controls, per variant and state.
- Status24 tokensInfo, success, warning and error, for alerts, toasts and fields.
- Chart5 tokensSeries colours for bars, lines and shares.
- Component33 tokensValues only one component uses, like tones and the scrollbar.
- Effect8 tokensShadow and glow colours.
Something wrong or missing on this page?
Report a problemSuggest an improvement