feat: add theme switching component and expose admin theme to iframe apps - #1284
Open
Arnold Stoba (arnoldstoba) wants to merge 2 commits into
Open
feat: add theme switching component and expose admin theme to iframe apps#1284Arnold Stoba (arnoldstoba) wants to merge 2 commits into
Arnold Stoba (arnoldstoba) wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Arnold Stoba (arnoldstoba)
force-pushed
the
feat/theme-switch-and-sdk-theme
branch
from
July 22, 2026 15:09
00992cd to
9b86f0e
Compare
…apps Component library (#1174): - mt-theme-select: select for light, dark, or system with localized labels - useTheme composable (VueUse-based): resolves the system preference, applies the resolved theme via data-theme, persists to localStorage - docs-app pages for both, plus Storybook stories and interaction tests Admin SDK (#1129): - context.getTheme(), context.subscribeTheme(), context.syncTheme() following the contextLocale pattern (message key: contextTheme) - zero-config: on SDK startup inside app iframes the resolved admin theme is mirrored onto the document root's data-theme attribute and kept in sync, so apps only need to update their SDK dependency. Apps that set data-theme themselves are left untouched. - documented in the Context API reference Closes #1174 Closes #1129
Arnold Stoba (arnoldstoba)
force-pushed
the
feat/theme-switch-and-sdk-theme
branch
from
July 22, 2026 15:12
9b86f0e to
65c10a0
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.
Description
Adds theme switching for Meteor apps and exposes the Administration's resolved theme to iframe apps through the Admin SDK.
🎥 Example usage in the Administration: https://www.loom.com/share/25b434e8ca85432eb303e6d30e0e9992
Closes #1174
Closes #1129
Component library (#1174)
mt-theme-select— select for choosinglight,dark, orsystem(localized labels, en/de).useThemecomposable — resolves thesystempreference, applies the resolved theme viadata-theme, persists tolocalStorage(keymt-theme). Built on@vueuse/core.Admin SDK (#1129)
context.getTheme(),context.subscribeTheme(),context.syncTheme()— following thecontextLocalepattern (message keycontextTheme).<html data-theme="…">and kept in sync. Updating the SDK dependency is the only change an app needs. Apps that setdata-themethemselves are left untouched; older admins without theme support are a silent no-op.handle('contextTheme', …)+publish('contextTheme', …), same wiring ascontextLocale.Known limitation
Iframes can briefly flash unthemed (white) on load: the theme arrives via an async postMessage round trip, so the first paint can happen before it. This could potentially be solved by one of my previous proposed fixes of adjusting the default bg color to transparent if inside of a embedded iframe context (passed through via admin-sdk).
Tests
Unit tests for the composable, the component, and the SDK theme API (incl. stale-response race, invalid values, rejected initial fetch, and the zero-config auto-sync). Changesets: minor for both packages.