Theming
Change the colors of the dimah-s3 components with --dimah-s3-* tokens, on the whole app or one container.
The components follow your shadcn theme out of the box, dark mode included.
To change their colors without changing your app, set --dimah-s3-* tokens.
Override a token
Set tokens after the stylesheet import, on :root:
@import "@dimah-s3/ui/styles.css";
:root {
--dimah-s3-primary: oklch(0.65 0.15 150);
--dimah-s3-destructive: oklch(0.55 0.2 25);
}
.dark {
--dimah-s3-primary: oklch(0.75 0.14 150);
}Or on any container, to style one area differently:
.avatar-panel {
--dimah-s3-primary: oklch(0.6 0.14 250);
--dimah-s3-card: var(--muted);
}Each token is read where it is used, so an override on a container reaches
every component inside it, including under a nested .dark class.
Tokens
Every token is unset by default and falls back to the matching shadcn variable.
| Token | Falls back to |
|---|---|
--dimah-s3-background | --background |
--dimah-s3-foreground | --foreground |
--dimah-s3-card | --card |
--dimah-s3-card-foreground | --card-foreground |
--dimah-s3-primary | --primary |
--dimah-s3-muted | --muted |
--dimah-s3-muted-foreground | --muted-foreground |
--dimah-s3-border | --border |
--dimah-s3-ring | --ring |
--dimah-s3-destructive | --destructive |
--dimah-s3-success | --success, else a green |
--dimah-s3-warning | --warning, else an amber |
shadcn has no --success or --warning. When your theme defines them, the
components use them; otherwise they use --dimah-s3-success-default and
--dimah-s3-warning-default, which the stylesheet sets for light and dark.
What the tokens cover
The tokens color the dimah-s3 parts: cards, rings, glyphs, meters, and status
colors. The shadcn primitives inside them (buttons, menus, dialogs, tooltips,
and toasts) keep reading your shadcn variables, such as --primary,
--accent, and --popover, so they match the rest of your app.
Use the tokens in your own parts
Each token has a Tailwind utility: bg-dimah-s3-card,
text-dimah-s3-primary, border-dimah-s3-border, and so on. Use them in parts
of your own so they follow the same overrides.
Frequently asked questions
Set --dimah-s3-primary instead. The --color-dimah-s3-* variables are the
Tailwind mappings, and they read the --dimah-s3-* tokens.
Yes. shadcn add writes the same color mappings and defaults into your CSS, so
the copied components read the same --dimah-s3-* tokens.