Install

Install from npm:

npm install @wintermuted/ui-theme

Or with yarn:

yarn add @wintermuted/ui-theme

Import the Stylesheet

Import once at your app entry point. In a Vite / bundler project:

import '@wintermuted/ui-theme';

Or reference directly in HTML:

<link rel="stylesheet" href="node_modules/@wintermuted/ui-theme/index.css" />

Dark Mode

Dark tokens activate when the data-theme="dark" attribute is set on document.documentElement. Remove the attribute to restore light mode.

// Enable dark mode
document.documentElement.setAttribute('data-theme', 'dark');

// Restore light mode
document.documentElement.removeAttribute('data-theme');

Persist the preference across sessions:

const saved = localStorage.getItem('theme');
if (saved === 'dark') {
  document.documentElement.setAttribute('data-theme', 'dark');
}

Design Tokens

All tokens are CSS custom properties on :root. Dark overrides live on [data-theme="dark"]. Use them directly in your own CSS:

.my-card {
  background: var(--wm-color-surface-solid);
  border: 1px solid var(--wm-color-border);
  border-radius: var(--wm-radius-sm);
  color: var(--wm-color-text);
  font-family: var(--wm-font-sans);
}

Color tokens

Spacing & shape tokens


Component Classes

The stylesheet includes opt-in component classes. All classes ship with both a wm- prefixed alias and a short alias for convenience.

Class Alias Description
.wm-card.cardSurface card with border, radius, and optional shadow
.wm-btn.btnBase button reset — combine with modifier below
.btn-primaryTonal primary action button
.btn-secondaryTonal secondary button
.btn-ghostTransparent with hover fill
.btn-dangerTonal destructive action
.btn-sm.wm-btn-smCompact size modifier for .btn
.wm-tag.tagNeutral pill — for keyword / skill lists
.wm-tag-accent.tag-accentAccent-tinted pill — for linked references
.badgeInline status badge (combine with semantic modifier)
.wm-listCustom dot-bullet list (no default list styling)
.wm-separatorThemed <hr>
.wm-side-navSticky sidebar nav with left-bar active indicator

Local Development

To iterate on the theme without publishing to npm, use npm link to symlink the local package into a consumer project:

# In the ui-theme repo
npm link

# In your consumer project
npm link @wintermuted/ui-theme

Bundler projects (Vite, webpack) may need to be told to allow symlinked files outside the project root. In Vite, set server.fs.allow and exclude the package from dep pre-bundling:

// vite.config.ts
export default defineConfig({
  server: {
    fs: { allow: ['..'] },
  },
  optimizeDeps: {
    exclude: ['@wintermuted/ui-theme'],
  },
});