@trinityui/design-system-css
v2.13.2
Published
Trinity Design System CSS package for non-React frameworks (Angular, Vue, static HTML).
Readme
@trinityui/design-system-css
CSS-only package for Trinity Design System. Provides all design tokens as CSS custom properties (--trinity-*) for Angular, Vue, static HTML, or any non-React application.
What's Included
- All design tokens as CSS variables — colors (6 brand palettes), spacing (20-step scale), typography, border radius, shadows, z-index, motion, opacity
- Light and dark mode — toggle via
data-theme="dark"attribute - Base element styles — sensible defaults for headings, body text, links, and form elements using Trinity styling
Install
pnpm add @trinityui/design-system-cssUsage
CSS import
@import "@trinityui/design-system-css/css";Angular (angular.json)
{
"styles": [
"node_modules/@trinityui/design-system-css/dist/trinity.css",
"src/styles.css"
]
}Vue / Vite
// main.ts
import '@trinityui/design-system-css';Static HTML
<link rel="stylesheet" href="node_modules/@trinityui/design-system-css/dist/trinity.css" />Dark Mode
<html data-theme="dark">CSS Variable Examples
/* Brand colors */
var(--trinity-navy-900) /* #050742 */
var(--trinity-coral-800) /* #FF6150 */
/* Semantic colors */
var(--trinity-card-bg) /* #FFFFFF (light) / #1C1C1F (dark) */
var(--trinity-text-primary) /* #09090B (light) / #F9FAFB (dark) */
/* Numbers: the monospace data style for table cells; a KPI number keeps
var(--trinity-font-family) and adds font-variant-numeric: tabular-nums */
var(--trinity-data-numeric-font-family)
var(--trinity-data-numeric-font-feature-settings) /* "tnum" 1 */
/* Spacing */
var(--trinity-space-4) /* 16px */
/* Radius */
var(--trinity-radius-card) /* 12px */
var(--trinity-radius-button) /* 9999px (pill) */
/* Shadows (whole box-shadow values) */
var(--trinity-shadow-card)
var(--trinity-shadow-modal)
var(--trinity-focus-ring) /* focus halo, a box-shadow in light and dark */These are the stylesheet names. dist/trinity.css lists every one. The React package's injectTrinityCssVariables() adds runtime variables with other names (--trinity-color-navy-900, --trinity-spacing-4). This stylesheet does not declare them.
Buttons on navy surfaces
A primary button is navy, so it disappears on a navy header, hero or sidebar (--trinity-bg-brand). Use the on-brand variables there. They are the same in light and dark mode, and they match the React theme's <Button color="onBrand">.
/* Filled: white fill, navy label, coral on hover */
.btn--on-brand { background: var(--trinity-button-on-brand-bg); color: var(--trinity-button-on-brand-text); }
.btn--on-brand:hover { background: var(--trinity-button-on-brand-bg-hover); color: var(--trinity-button-on-brand-text-hover); }
/* Outlined: white border and label, the same coral hover */
.btn--on-brand-outlined { background: var(--trinity-button-on-brand-outlined-bg); color: var(--trinity-button-on-brand-outlined-text); border: 2px solid var(--trinity-button-on-brand-outlined-border); }
.btn--on-brand-outlined:hover { background: var(--trinity-button-on-brand-outlined-bg-hover); border-color: var(--trinity-button-on-brand-outlined-border-hover); color: var(--trinity-button-on-brand-outlined-text-hover); }
/* Keyboard focus: a white outline, visible on the navy */
.btn--on-brand:focus-visible,
.btn--on-brand-outlined:focus-visible { outline: 2px solid var(--trinity-button-on-brand-focus-outline); outline-offset: 2px; }The pressed (-bg-active, -text-active) and disabled (-bg-disabled, -text-disabled, -border-disabled) variables complete the set. The full pattern is in the CSS guide (docs/INSTRUCTIONS_CSS.md, "Buttons on navy surfaces").
Related
@trinityui/design-system— Full React component library- See the main README for the complete component catalog and architecture overview
