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

Resolver API

This reference covers the resolver exports from @pierre/theming.

Exports

ExportKindPurpose
createThemeResolverFunctionCreates an isolated loader registry and resolved-theme cache.
ThemeResolverTypeDefines the resolver methods.
ThemeLoaderTypeDefines an asynchronous theme loader.
DuplicateThemeErrorClassReports a second registration for the same name.
UnregisteredThemeErrorClassReports a resolve request for a name with no loader.
UnresolvedThemeErrorClassReports a synchronous batch read with an unresolved name.

ThemeResolver methods

MethodPurpose
registerTheme(name, loader)Registers one loader.
registerThemeIfAbsent(name, loader)Registers one loader only when the name is free.
hasRegisteredTheme(name)Tests whether a loader exists.
resolveTheme(name)Loads and caches one theme.
resolveThemes(names)Loads and caches themes in input order.
getResolvedTheme(name)Reads one cached theme or returns undefined.
getResolvedThemes(names)Reads cached themes in input order.
getResolvedOrResolveTheme(name)Returns a cached theme or starts its load.
hasResolvedTheme(name)Tests whether one cached theme exists.
hasResolvedThemes(names)Tests whether all named themes exist in the cache.
seedResolvedTheme(name, theme)Adds one resolved object without a loader.
seedResolvedThemes(entries)Adds several resolved objects without loaders.
clearResolvedThemes()Clears cached themes and active loads but keeps loaders.

Each loader returns a ThemeLike object or a module object with that value on default.

Referenced from SKILL.md