feat(theme): allow deployments to register extra theme tokens - #42874
Open
gabotorresruiz wants to merge 1 commit into
Open
feat(theme): allow deployments to register extra theme tokens#42874gabotorresruiz wants to merge 1 commit into
gabotorresruiz wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #42874 +/- ##
=======================================
Coverage 66.37% 66.37%
=======================================
Files 2857 2857
Lines 161048 161053 +5
Branches 37046 37049 +3
=======================================
+ Hits 106892 106898 +6
+ Misses 52141 52139 -2
- Partials 2015 2016 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Custom theme tokens consumed by a deployment or plugin via useTheme (beyond Ant Design and Superset's built-in tokens) are flagged as unknown in the theme editor, with no supported way to register them. Add an EXTRA_THEME_TOKENS config, shipped in the common bootstrap payload and merged into the theme editor's valid-token set, mirroring EXTRA_CATEGORICAL_COLOR_SCHEMES. Empty by default, so behavior is unchanged unless a deployment opts in.
gabotorresruiz
force-pushed
the
feat/extra-theme-tokens
branch
from
August 7, 2026 14:05
855f5e8 to
b60e693
Compare
gabotorresruiz
marked this pull request as ready for review
August 7, 2026 15:04
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.
SUMMARY
Superset's theme system supports custom tokens beyond Ant Design's (for example
brandLogoUrl,echartsOptionsOverrides, and thelabel*/button*tokens inSupersetSpecificTokens). Deployments, white-label distributors, and custom chart plugins legitimately define their own tokens and consume them viauseTheme. Today the theme editor validates token names against a fixed allowlist (antdTokenNames.ts), so any such deployment-specific token is flagged as an "Unknown token" warning with no supported way to register it.This adds an
EXTRA_THEME_TOKENSconfig that lets a deployment register extra custom token names. It follows the exact pattern already used forEXTRA_CATEGORICAL_COLOR_SCHEMES/EXTRA_SEQUENTIAL_COLOR_SCHEMES: a config default, shipped to the frontend in the common bootstrap payload, and merged into the theme editor's valid-token set at runtime.TESTING INSTRUCTIONS
EXTRA_THEME_TOKENS = ["myBrandToken"]insuperset_config.py."myBrandToken": "..."inside a theme'stokenobject."foo"still warns).ADDITIONAL INFORMATION