@dtpr/ui

Theming

The dtpr cascade layer and the CSS custom properties used by @dtpr/ui/vue.

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.

TokenDefaultPurpose
--dtpr-color-accent#0f5153Primary accent.
--dtpr-color-accent-contrast#ffffffOn-accent text color.
--dtpr-color-borderrgba(0, 0, 0, 0.1)Borders around cards and sections.
--dtpr-color-text#111111Body text.
--dtpr-color-text-muted#555555Secondary text (variable labels, citations).
--dtpr-color-surface#ffffffCard + section background.
--dtpr-color-warning#f04a4aMissing-required warnings.
--dtpr-font-heading'Red Hat Text', sans-serifHeadings.
--dtpr-font-body'Red Hat Text', sans-serifBody text.
--dtpr-space-xs0.25remSpacing step.
--dtpr-space-sm0.5remSpacing step.
--dtpr-space-md1remSpacing step.
--dtpr-space-lg1.5remSpacing step.
--dtpr-space-xl2remSpacing step.
--dtpr-radius-sm0.25remVariable cards, icon frames.
--dtpr-radius-md0.5remElement + section cards.
--dtpr-radius-lg1remReserved.

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.

See also

Copyright © 2026