feat(portal): theme switcher with system preference + card summary fallback#61
Draft
BatLeDev wants to merge 1 commit into
Draft
feat(portal): theme switcher with system preference + card summary fallback#61BatLeDev wants to merge 1 commit into
BatLeDev wants to merge 1 commit into
Conversation
5c10a7a to
6cc6c0e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(portal): theme switcher with system preference support — adds the sharedtheme-switcherfrom@data-fair/lib-vuetifyto bothlayout-nav-bar(public navbar) andlayout-personal-app-bar(logged-in personal app bar). The portal's theme is read fromportalConfig.theme(notsession.fullSite), so the switcher receives it via the newthemeprop on the lib component. The Vuetify plugin (03-vuetify.ts) now treats thethemecookie asTheme('system' | 'default' | 'dark' | 'hc' | 'hc-dark', defaulting to'system') and resolves it via a localresolvePortalThemehelper. The SSR variant readsprefers-color-schemefrom vuetify-nuxt-module's SSR client hints (newly enabled innuxt.config.ts), the client variant useswindow.matchMedia.forced-colors(high-contrast) cannot be resolved at SSR — vuetify-nuxt-module does not exposeSec-CH-Forced-Colors— so HC requires an explicit user choice. Logic duplicates the lib'sresolveThemerather than reusing it, because the portal needs SSR client-hint integration that the lib helper does not provide.Depends on data-fair/lib#34.