Skip to content

feat: canonical theme picker and repo remotes - #3

Merged
LizAinslie merged 1 commit into
mainfrom
feat/canonical-theme-picker-remotes
Sep 14, 2026
Merged

LizAinslie merged 1 commit into
mainfrom
feat/canonical-theme-picker-remotes

Conversation

@LizAinslie

Copy link
Copy Markdown
Contributor

Summary

  • Canonical theme picker: ThemePicker.astro adopts the Keel switcher look — a compact popup with <ul class="menu menu-sm">, one menu-title per site-theme family (via groupChromeThemes), swatch dots, and short Catppuccin labels. Code themes are now the curated list from CODE_THEME_OPTIONS / codeThemeOptions(config) instead of every site theme. The chrome preference contract (data-pref, data-label, kdc:*, applyPrefs/syncControls, data-theme/data-code-theme, follow) is unchanged.
  • Source control: RepoConfig gains remotes?: FooterLink[]. defineDocsChrome derives scm from repo.remotes (deduplicated by href, order preserved) or a single { label: 'Source', href: repo.url }; explicit scm still wins. ScmMenu renders one link as a single icon link and several as the existing popover menu.
  • Tests for both derivations and the curated code-theme list; README + CHANGELOG updated.

Changelog

Added

  • Curated code themes. Core exports CodeThemeOption, CODE_THEME_OPTIONS (follow plus the Catppuccin flavours, Nord and the Kolektiv palettes) and codeThemeOptions(config), which restricts the list to the themes a site offers (so themeFamilies applies) and appends any config.themes. ThemePicker renders site themes grouped by family — one menu-title per family, Catppuccin shown by flavour (for example Mocha) — with the curated code themes below follow.
  • RepoConfig.remotes (FooterLink[]). When supplied, defineDocsChrome derives scm from it, deduplicated by href and order-preserving; otherwise it derives a single { label: 'Source', href: repo.url }. An explicit scm still wins. deriveScm(repo) is exported.

Changed

  • ScmMenu renders a single icon link when the deduplicated scm list has one entry (previously it always opened a popover); several links keep the popover menu and zero links render nothing. defineDocsChrome no longer emits the duplicate Source / yuri.capital pair for repo.url.

Verification

  • pnpm test, pnpm typecheck, pnpm build, playground build all pass.
  • Playground before/after diff limited to the theme picker, the SCM control, and the Tailwind utility classes those markup changes pull in.

Adopt the Keel theme picker as canonical (family-grouped site themes with menu-title headings, short Catppuccin labels, curated code themes via CODE_THEME_OPTIONS/codeThemeOptions) and derive ScmMenu links from RepoConfig.remotes or a single Source link for repo.url. ScmMenu renders one link as an icon link and several as the popover menu.
@LizAinslie
LizAinslie merged commit 9e35b46 into main Sep 14, 2026
1 check passed
@LizAinslie
LizAinslie deleted the feat/canonical-theme-picker-remotes branch September 14, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant