Skip to content

feat(portal): theme switcher with system preference + card summary fallback#61

Draft
BatLeDev wants to merge 1 commit into
masterfrom
feat-theme-switcher
Draft

feat(portal): theme switcher with system preference + card summary fallback#61
BatLeDev wants to merge 1 commit into
masterfrom
feat-theme-switcher

Conversation

@BatLeDev
Copy link
Copy Markdown
Member

@BatLeDev BatLeDev commented May 19, 2026

  • feat(portal): theme switcher with system preference support — adds the shared theme-switcher from @data-fair/lib-vuetify to both layout-nav-bar (public navbar) and layout-personal-app-bar (logged-in personal app bar). The portal's theme is read from portalConfig.theme (not session.fullSite), so the switcher receives it via the new theme prop on the lib component. The Vuetify plugin (03-vuetify.ts) now treats the theme cookie as Theme ('system' | 'default' | 'dark' | 'hc' | 'hc-dark', defaulting to 'system') and resolves it via a local resolvePortalTheme helper. The SSR variant reads prefers-color-scheme from vuetify-nuxt-module's SSR client hints (newly enabled in nuxt.config.ts), the client variant uses window.matchMedia. forced-colors (high-contrast) cannot be resolved at SSR — vuetify-nuxt-module does not expose Sec-CH-Forced-Colors — so HC requires an explicit user choice. Logic duplicates the lib's resolveTheme rather than reusing it, because the portal needs SSR client-hint integration that the lib helper does not provide.

Depends on data-fair/lib#34.

@github-actions github-actions Bot added feature and removed feature labels May 19, 2026
@BatLeDev BatLeDev force-pushed the feat-theme-switcher branch from 5c10a7a to 6cc6c0e Compare May 19, 2026 14:23
@github-actions github-actions Bot added feature and removed feature labels May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant