Add theme background color config options#12405
Merged
mayagbarnes merged 10 commits intodevelopfrom Sep 4, 2025
Merged
Conversation
Contributor
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
Contributor
✅ PR preview is ready!
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds configurable background colors for theming with support for seven color categories (red, orange, yellow, blue, green, violet, gray) that can be used throughout the application. The background colors follow a three-tier fallback system: explicit background color configuration takes priority, followed by deriving from main color configuration with appropriate opacity, and finally falling back to default values.
Key Changes
- Added seven new background color configuration options for both main theme and sidebar theme
- Implemented smart fallback logic that derives background colors from main colors when explicit background colors aren't provided
- Added comprehensive test coverage for the new functionality
Reviewed Changes
Copilot reviewed 10 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| proto/streamlit/proto/NewSession.proto | Adds protobuf definitions for the seven new background color fields |
| lib/streamlit/config.py | Adds configuration options with detailed documentation for all background colors |
| lib/tests/streamlit/runtime/app_session_test.py | Updates test mocks and assertions to include new background color configurations |
| lib/tests/streamlit/proto_compatibility_test.py | Adds protobuf field definitions to compatibility tests |
| lib/tests/streamlit/config_test.py | Adds comprehensive config option testing for background colors |
| frontend/lib/src/theme/utils.ts | Implements background color resolution logic with fallback hierarchy |
| frontend/lib/src/theme/utils.test.ts | Adds extensive unit tests for background color functionality |
| e2e_playwright/theming/custom_main_colors_test.py | Updates test configuration to demonstrate derived background colors |
| e2e_playwright/theming/custom_background_colors_test.py | Adds new E2E test for explicit background color configuration |
| e2e_playwright/theming/custom_background_colors.py | Creates test app showcasing background color usage across UI elements |
sfc-gh-lmasuch
approved these changes
Sep 3, 2025
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.
Describe your changes
Add configurable background colors for theming:
redBackgroundColororangeBackgroundColoryellowBackgroundColorblueBackgroundColorgreenBackgroundColorvioletBackgroundColorgrayBackgroundColorOrder of precedence:
redBackgroundColorredBackgroundColor, derives it from a providedredColor(uses 10% opacity for light theme and 20% opacity for dark theme)Testing Plan