Theming

The whole design runs on CSS variables prefixed with --trc-. Override them to adapt trc-ui to your brand, globally or for a single area.

Change the accent

The accent is the only color of the design: pill dots, accent words, step numbers, focus rings. Set it once on :root, after importing trc-ui/styles.css.

CSSglobals.css
:root {
  --trc-accent: #d41367;
}

Theme a single area

Variables cascade: set them on any element and every component inside follows.

A magenta section

TSDemo.tsx
<div style={{ "--trc-accent": "#d41367" }}>
  <Heading size="lg">A *magenta* section</Heading>
  <StepNumber n={1} />
  <PillButton>Continue</PillButton>
</div>

Light accents

Text on the accent uses --trc-on-accent, near black by default. It suits most bright accents; for a dark accent, switch it to white.

:root {
  --trc-accent: #f5c518;
  --trc-on-accent: #0b0c0f;
}

One accent, on purpose

Everything colored draws the eye, so color has to stay rare. trc-ui has no secondary color and no gradients: depth comes from shades of grey, emphasis from the accent alone.

Color tokens

TokenDefaultUse
--trc-bg#0b0c0fPage background.
--trc-surface#151618Cards, footer, panels.
--trc-surface-raised#1b1c1fHovered cards.
--trc-surface-alt#232428Second level, to tell two side-by-side blocks apart.
--trc-fg#ffffffHeadings and primary text.
--trc-fg-mutedrgba(255,255,255,.72)Body text.
--trc-fg-subtlergba(255,255,255,.55)Hints, secondary details.
--trc-fg-faintrgba(255,255,255,.4)Placeholders.
--trc-borderrgba(255,255,255,.08)Barely visible borders.
--trc-border-strongrgba(255,255,255,.16)Form controls.
--trc-accent#08c8d8The single accent color.
--trc-on-accent#0b0c0fText and icons on the accent.
--trc-danger#ff6b6bForm errors only.

Type, shape and motion

TokenDefaultUse
--trc-font"Montserrat", …Font of the whole design.
--trc-font-monoui-monospace, …Code.
--trc-radius16pxCards, heroes, footer.
--trc-radius-sm10pxSmall elements.
--trc-easecubic-bezier(.77,0,.175,1)Pill stretch curve.
--trc-ease-outcubic-bezier(.22,1,.36,1)Entrances, menus.
--trc-duration500msPill stretch duration.