theming

Use when an app uses @pierre/theming to list, resolve, select, switch, persist, or apply themes, including color modes, theme controllers, React state, UI colors, and bundled Pierre or Shiki collections.

Install
npx skills add 'https://github.com/pierrecomputer/pierre/tree/main/skills/theming'
Download bundle ↓
main · 1831817Scanned 2026-09-15

Contributors

GitHub-linked commit authors for this SKILL.md at the saved revision. Co-authors and history before file renames are not included.

File history ↗
View on GitHub
← Back to SKILL.md

Recipe: use one theme controller

Use one controller when the app shares one color mode and one light/dark theme selection.

Create the catalog and controller in one module:

import { createThemeCatalog, createThemeController } from '@pierre/theming';
import { themes } from '@pierre/theming/themes';

export const themeCatalog = createThemeCatalog({
  themes,
  defaultLightThemeName: 'pierre-light',
  defaultDarkThemeName: 'pierre-dark',
});

export const themeController = createThemeController({
  catalog: themeCatalog,
  defaultMode: 'system',
  storageKey: 'app-theme',
});

Import the same controller wherever the app reads or changes theme state. Call destroy() when the application tears down the controller module.

Referenced from SKILL.md