feat: allow apps to provide themes - #2964
Draft
dschmidt wants to merge 1 commit into
Draft
Conversation
dschmidt
force-pushed
the
feat/app-provided-themes
branch
2 times, most recently
from
July 28, 2026 12:26
23ccd32 to
52e3aa7
Compare
dschmidt
force-pushed
the
feat/app-provided-themes
branch
from
July 28, 2026 12:29
52e3aa7 to
861ffe2
Compare
Adds a generic mechanism for (external) apps to provide selectable themes to the theme switcher, without any app-specific code in the core. - theme store: initializeThemes() merges additional theme configs, so app themes join the switcher alongside the deployment's light/dark themes. - announceTheme(): reads themes from external_apps[].config.themes, loads them parallel to the base theme and injects their stylesheets before the first apply, so a persisted app-theme selection is honored on first paint without a flash. Asset paths are resolved relative to the app's own URL, so a theme's theme.json/stylesheets are found wherever the app is served (dev or prod). - setAndApplyTheme(): expose the active theme as html[data-theme] so themes can attach structural CSS the token system cannot express, and reset custom props a theme does not define instead of leaking them from the previous theme (e.g. a pixel font). Apps declare themes in their manifest's config block, which the server surfaces in external_apps[].config; the Windows 95 theme in the web-extensions repo is the first consumer.
dschmidt
force-pushed
the
feat/app-provided-themes
branch
from
July 28, 2026 17:24
861ffe2 to
aa20df8
Compare
Contributor
Author
|
Of course this collides a bit with the intention of unifying themes via a central theme.json, obviously this doesnt help for mobile client e.g. :/ So not sure this is a really good idea after all, my idea was just that we have an established approach to distribute apps (unlike themes) |
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.
Lets apps provide selectable themes to the theme switcher, generically (no
app-specific code in the core).
initializeThemesmerges app-provided theme configs alongside light/dark.announceThemeloads them before the first apply (no flash) and resolvesasset paths relative to the app's own URL (works in dev and prod).
setAndApplyThemesetshtml[data-theme](so themes can add structural CSS)and clears props a theme does not define (no leak across switches, e.g. fonts).
First consumer: the Windows 95 theme extension, opencloud-eu/web-extensions#511.
Interim / draft: themes are read from
external_apps[].config.themes,piggybacking on the per-app
configbag so it works without a backend change(marked
INTERIMinannounceTheme). The clean shape is a first-classexternal_apps[].themesfield, needing coordinated changes in the opencloudbackend and extension-sdk, then a one-line switch here.