Quick switch
Click a preset to re‑skin the live demo below. The same buttons, inputs, badges, and stat cards — different palette and radius. Each preset is one CSS module load.
Install & import a theme
A theme is one CSS module that sets --tc-* custom
properties on :root. Install the kit, then import
exactly one preset — the kit reads those tokens through Shadow DOM,
so every component re‑skins at once.
The base tokens preset is the light default that every
other preset extends, so you only ever import one. Imports are
idempotent — loading a theme twice is a no‑op.
Three layers of override
Every kit component participates in a layered cascade. Override at whichever level fits.
1. Global semantic tokens
Set on :root. Cascade through Shadow DOM into every
component. This is the layer the four presets configure.
2. Per-component tokens
Each component exposes finer-grained hooks like
--tc-btn-primary-bg,
--tc-input-border,
--tc-table-row-hover. They default to the global
semantic tokens but can be overridden per‑component:
3. Per-instance overrides
Pass the variable as inline style. Affects only that one element.
Bundled presets
Pick one. They're all idempotent — importing twice is a no‑op.
| Preset | Import | What it changes |
|---|---|---|
| tokens (default) | @ra9/tan-compose-kit/themes/tokens |
Light theme, warm-tan accent. The base every other preset extends. |
| dark | @ra9/tan-compose-kit/themes/dark |
Dark surface + ink, accent brightened for contrast. |
| bootstrap | @ra9/tan-compose-kit/themes/bootstrap |
Bootstrap 5 primary blue, semantic palette, default radius. |
| tailwind | @ra9/tan-compose-kit/themes/tailwind |
Tailwind slate/indigo palette, default radius scale. |
| material | @ra9/tan-compose-kit/themes/material |
Material Design 3 indigo, Roboto, elevation-style shadows. |
| shadcn | @ra9/tan-compose-kit/themes/shadcn |
shadcn/ui zinc neutrals, tighter radii, Inter typography. |
Switch themes at runtime
Because a preset is just :root tokens, switching is a
matter of swapping which token block is live. Inject the preset's
CSS into a <style> you can replace — exactly what
the demo at the top of this page does:
Persist the choice in localStorage and re‑apply
on load so it survives a refresh. Nothing re‑renders — every
component picks up the new tokens through the cascade instantly.
Dark mode from system preference
To follow the OS setting with zero JavaScript, wrap the dark tokens in a media query and load it after the base tokens:
Combine the two: default to the system preference, but let an
explicit toggle win by writing tokens to a higher‑specificity
selector like :root[data-theme="dark"].
Using alongside Bootstrap or Tailwind
Bootstrap
Tailwind
Other frameworks
Bulma, Bootstrap 4, plain CSS — same shape. Override the
handful of --tc-color-* tokens to match the
framework's brand color and you're done.
Writing your own preset
Just CSS. Set the tokens you want to change; the rest cascade from the base.
Load that file after the kit's base tokens and every component updates.
The full token list
See Docs for the complete catalogue, but the most-used:
--tc-color-accent/-hover/-soft— primary brand color and its derivatives--tc-color-ink/-soft/-muted— three steps of text emphasis--tc-color-surface/-alt— background surfaces--tc-color-rule/-strong— borders and dividers--tc-color-{info,success,warning,danger}+ matching-bgand-fg--tc-radius-{sm,md,lg,pill}--tc-shadow-{sm,md,lg}--tc-space-{1..8}— spacing scale used by layout primitives--tc-focus-ring— single source of truth for focus outlines--tc-font-{sans,mono}