Foundations
Theming
Components never use a raw colour. They read semantic roles from CSS variables, so the whole interface follows light, dark, and your overrides from one file.
The theme is one stylesheet. aback-ui init writes it to styles/aback.css; the npm package ships the same file as @aback-ui/tokens/tokens.css. It holds three things:
- An
@theme inlineblock that turns each variable into Tailwind utilities, so--cardbecomesbg-card. - A
:rootblock with the light values. - A
.darkblock with the dark values, used when<html>has thedarkclass. See Dark mode.
@theme inline {
--color-background: var(--background);
--color-card: var(--card);
--color-link: var(--link);
/* one line per role */
}
:root {
--background: #ffffff;
--card: #ffffff;
--link: #005d95;
}
.dark {
--background: #0a0a0a;
--card: #171717;
--link: #33b7ff;
}Colour roles
Build with the role, not the hex. The swatches below use the live variables; switch the theme in the header to see both sets.
Surfaces
bg-background--backgroundThe page canvas.bg-card--cardCards, panels, and popovers.bg-muted--mutedQuiet fills: table headers, code, hover rows.
Text
text-foreground--foregroundBody text and headings.text-muted-foreground--muted-foregroundSecondary text. The lowest readable tier.text-link--linkText links and selected navigation.
Actions
bg-primary--primaryThe default button. Neutral ink, not blue.bg-brand-fill--brand-fillBrand buttons and step markers.bg-destructive--destructiveDelete and other irreversible actions.
Lines and focus
border-border--borderCards, dividers, and table rules.border-input--inputText fields, selects, and checkboxes.ring-focus-ring--focus-ringThe keyboard focus indicator.
Status colours, the full Aback Blue ramp, and every hex value are on the Design tokens page.
Customize the theme
Override variables after the theme import. Every component that reads the role changes with it.
@import "tailwindcss";
@import "../styles/aback.css";
/* Your brand, replacing Aback Blue */
:root {
--brand-fill: #6d28d9;
--on-brand-fill: #ffffff;
--link: #5b21b6;
--focus-ring: #7c3aed;
}
.dark {
--brand-fill: #c4b5fd;
--on-brand-fill: #1e1b4b;
--link: #c4b5fd;
--focus-ring: #a78bfa;
}Check contrast after every override
With the CLI, you can also edit styles/aback.css directly: it is your file. Overriding in your own stylesheet keeps the change obvious when you compare against a newer theme with aback-ui diff theme.
- Use roles in componentsWrite bg-card and text-link, never a hex value or bg-blue-600.
- Keep primary neutralThe default button is ink. Brand blue is for brand actions, links, and selection.
- No opacity on textFaded text fails contrast. Use text-muted-foreground instead.
- Square cornersEvery radius is zero. Do not add rounded corners or gradient buttons.