Theming
Theming
@dtpr/ui/vue/styles.css wraps every rule in @layer dtpr. Your own cascade layer outranks it by default — overrides "just work."Cascade layer
@import '@dtpr/ui/vue/styles.css'; /* defines @layer dtpr */
Every DTPR style lives in @layer dtpr. CSS cascade-layer order means any unlayered CSS, or any higher-priority layer you declare, will win. To guarantee an explicit order, declare the layers first:
@layer reset, tailwind, dtpr, app;
@import 'tailwindcss';
@import '@dtpr/ui/vue/styles.css';
/* your own styles follow, implicitly in layer `app` */
In the example above, app wins over dtpr wins over tailwind wins over reset.
Tokens
All tokens are declared on :where(html) so their specificity is zero — override at any root or container.
| Token | Default | Purpose |
|---|---|---|
--dtpr-color-accent | #0f5153 | Primary accent. |
--dtpr-color-accent-contrast | #ffffff | On-accent text color. |
--dtpr-color-border | rgba(0, 0, 0, 0.1) | Borders around cards and sections. |
--dtpr-color-text | #111111 | Body text. |
--dtpr-color-text-muted | #555555 | Secondary text (variable labels, citations). |
--dtpr-color-surface | #ffffff | Card + section background. |
--dtpr-color-warning | #f04a4a | Missing-required warnings. |
--dtpr-font-heading | 'Red Hat Text', sans-serif | Headings. |
--dtpr-font-body | 'Red Hat Text', sans-serif | Body text. |
--dtpr-space-xs | 0.25rem | Spacing step. |
--dtpr-space-sm | 0.5rem | Spacing step. |
--dtpr-space-md | 1rem | Spacing step. |
--dtpr-space-lg | 1.5rem | Spacing step. |
--dtpr-space-xl | 2rem | Spacing step. |
--dtpr-radius-sm | 0.25rem | Variable cards, icon frames. |
--dtpr-radius-md | 0.5rem | Element + section cards. |
--dtpr-radius-lg | 1rem | Reserved. |
Examples
Color override
:root {
--dtpr-color-accent: #7c3aed; /* violet */
--dtpr-color-warning: #ef4444; /* red-500 */
}
Font override
:root {
--dtpr-font-heading: 'Inter Tight', system-ui, sans-serif;
--dtpr-font-body: 'Inter', system-ui, sans-serif;
}
Scoped override
Tokens cascade, so you can swap them inside a container without touching the root:
.marketing-section {
--dtpr-color-accent: #0ea5e9;
}
All DTPR components rendered under .marketing-section pick up the new accent.
Container queries
The components use CSS @container (inline-size) queries instead of viewport media queries. A DtprElementGrid goes from 1 column to 2 to 3 based on its wrapper's inline-size — wrap it in a narrow sidebar and it stays one column even on a wide viewport.