No description
Find a file
Natalie 682a9cf9a4 test(site-themes): add unit tests for theme registry resolver + console switcher
Adds vitest (node + jsdom) with focused unit coverage for the pure-logic
surfaces of the site-theme package:
- registry codec: deepMerge, cloneMod, encodeThemeMod/decodeThemeMod
- registry resolver: alias normalisation + preview/configured/fallback precedence
- theme-switcher: window.quinnTheme list/current/set validation + help

29 tests, all passing. No runtime deps changed; vitest + jsdom added as dev deps.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 15:08:48 -04:00
.forgejo/workflows ci: add publish workflow for ct-forge runners + local verdaccio/pypi/swift; set publish flags (org cocotte) 2026-06-29 21:46:48 -04:00
src build: ship compiled dist + fix type errors (v0.1.1) 2026-06-29 19:40:47 -04:00
test test(site-themes): add unit tests for theme registry resolver + console switcher 2026-06-30 15:08:48 -04:00
.gitignore build: ship compiled dist + fix type errors (v0.1.1) 2026-06-29 19:40:47 -04:00
package-lock.json test(site-themes): add unit tests for theme registry resolver + console switcher 2026-06-30 15:08:48 -04:00
package.json test(site-themes): add unit tests for theme registry resolver + console switcher 2026-06-30 15:08:48 -04:00
README.md refactor: rename @cocotte/themes -> @cocotte/site-themes 2026-06-29 15:50:55 -04:00
tsconfig.build.json build: ship compiled dist + fix type errors (v0.1.1) 2026-06-29 19:40:47 -04:00
tsconfig.json feat(@cocotte/themes): extract UI theme package to @ct/@packages 2026-06-29 13:04:10 -04:00
vitest.config.ts test(site-themes): add unit tests for theme registry resolver + console switcher 2026-06-30 15:08:48 -04:00

@cocotte/site-themes

Site theme registry, resolver, and selectable theme families for Cocotte sites.

Extracted from quinn.www/src/themes. Ships:

  • luxe-dark (luxeDarkTheme) — the default dark-luxe base (gold / cream / soft-pink).
  • Kuromi family — kuromiNeon, kuromiStark, kuromiDuo.
  • Cali-Barbie family — barbieLight, barbieDark.
  • THEME_REGISTRY, resolveSiteTheme(), applySiteThemeChrome(), preview/custom-mod helpers.
  • installThemeSwitcher() — runtime window.__quinnTheme console.
  • ThemeViewer — React dev component for previewing the registry.

Each family is a DeepPartial<ThemeInterface> (from @cocotte/ui-theme) deep-merged onto the base luxe adapter at runtime, so any styled-component reading p.theme.* re-skins automatically.

Selection precedence

  1. ?theme=<name> URL query (preview override, persisted to localStorage)
  2. localStorage preview pin
  3. __PROVIDER_CONFIG__.theme.activeTheme (brand/admin default)
  4. luxe-dark (ultimate fallback)