mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-14 11:05:45 -05:00
[PR #17396] [CLOSED] feat: Theming system #11211
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/17396
Author: @silentoplayz
Created: 9/12/2025
Status: ❌ Closed
Base:
dev← Head:theming-expirmentaiton-part-2-(revamp)📝 Commits (10+)
fb5a740feat: Theming system9b141acfeat: Add full theme schema to documentation9ddff46remove: unused const DEFAULT_PARTICLE_CONFIG8f93ce1fix: base 'her'acc92d4feat: Replace theme import warning toast with confirmation modalb7ab4c0feat: Add random color generator to theme editorb042aa8feat: Add gradient editor to theme customizer49ad0a8feat: Add and enhance gradient editor in theme customizer6d923afUpdate ThemeDocumentationModal.svelte3d03bd0Update ThemeEditorModal.svelte📊 Changes
65 files changed (+7598 additions, -1116 deletions)
View changed files
📝
package-lock.json(+3552 -459)📝
package.json(+10 -1)📝
src/app.css(+14 -0)📝
src/lib/apis/auths/index.ts(+1 -0)📝
src/lib/components/admin/Evaluations/Feedbacks.svelte(+2 -2)📝
src/lib/components/admin/Evaluations/Leaderboard.svelte(+2 -2)📝
src/lib/components/admin/Settings/Audio.svelte(+4 -4)📝
src/lib/components/admin/Settings/CodeExecution.svelte(+6 -6)📝
src/lib/components/admin/Settings/Connections/OllamaConnection.svelte(+2 -2)📝
src/lib/components/admin/Settings/Connections/OpenAIConnection.svelte(+1 -1)📝
src/lib/components/admin/Settings/Documents.svelte(+9 -9)📝
src/lib/components/admin/Settings/General.svelte(+1 -1)📝
src/lib/components/admin/Settings/Images.svelte(+1 -1)📝
src/lib/components/admin/Settings/Interface/Banners.svelte(+6 -3)📝
src/lib/components/admin/Settings/Pipelines.svelte(+3 -3)📝
src/lib/components/admin/Settings/WebSearch.svelte(+3 -3)📝
src/lib/components/admin/Users/Groups.svelte(+1 -1)📝
src/lib/components/admin/Users/UserList.svelte(+3 -3)📝
src/lib/components/channel/Navbar.svelte(+0 -4)📝
src/lib/components/chat/Chat.svelte(+5 -1)...and 45 more files
📄 Description
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch.Changelog Entry
Description
This pull request introduces a comprehensive, multi-layered theming system to Open WebUI, allowing for extensive customization of the user interface. The feature is centered around a new UI in the user settings modal and a robust set of Svelte stores and utility functions that handle everything from theme application to community theme management and automatic updates.
Added
Core Theming Infrastructure:
src/lib/theme.ts): A new barrel file that exports all theme-related functionalities from modularized files, providing a clean API for the rest of the application.src/lib/stores/theme.ts):themes: A Svelte store (Map<string, Theme>) initialized withdefault.jsonfor built-in themes.communityThemes: A store (Map<string, Theme>) for user-installed themes, persisted tolocalStorage.currentThemeStore/liveThemeStore: Stores that hold the active and previewed theme objects, respectively.themeUpdates/themeUpdateErrors: Stores that track available updates and fetch errors for community themes.src/lib/themes/apply.ts):applyTheme(theme, isLiveUpdate)function which orchestrates the entire process of rendering a theme.cleanupTheme(): A helper function that removes previously injected styles and CSS variables to ensure a clean slate before applying a new theme._applyGlobalThemeStyles(theme): A private function that handles injecting custom CSS, applying base theme variables, overriding with theme-specific variables, and setting<html>classes (.light,.dark,.oled-dark,.her).src/lib/themes/community.ts):loadCommunityThemes(): Loads user themes fromlocalStorageon startup.saveCommunityThemes(): Persists thecommunityThemesstore tolocalStoragewith quota-exceeded error handling.addCommunityTheme,updateCommunityTheme,removeCommunityTheme.checkForThemeUpdates(),updateCommunityThemeFromUrl(), andisNewerVersion().User Interface Components:
src/lib/components/chat/Settings/Themes.svelte):addThemeHandler(for URLs),importThemeFromFile,createNewTheme,saveTheme,copyTheme, andexportTheme.$:) to automatically filter (filteredThemes) and sort (sortedThemes) the list of themes as the user types or changes sort order.src/lib/components/common/ThemeEditorModal.svelte):updateevent, which triggersapplyTheme(..., true).ThemeImportWarningModal.svelte: Warns the user if a theme'stargetWebUIVersiondoes not match the current WebUI version.ConfirmDialog.svelte: A generic confirmation dialog used for both deleting a theme and for displaying a security warning when a theme contains ananimationScript.Changed
src/routes/(app)/+layout.svelte):applyThemeon mount to apply the user's saved theme.checkForThemeUpdatesto trigger the automatic update check in the background.Deprecated
chatBackgroundImageUrlproperty within a theme'stheme.json.Removed
Security
Themes.sveltenow explicitly checks if a theme contains theanimationScriptproperty.ConfirmDialog.sveltemodal is displayed, requiring the user to acknowledge the security risks of running arbitrary code from an untrusted source before the theme can be installed via the_finalizeAddThemefunction.Breaking Changes
chatBackgroundImageUrlproperty to achieve a similar effect. This change centralizes all appearance-related settings into the newtheme.jsonschema, providing a more unified and powerful customization experience.Additional Information
Screenshots or Videos
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.