Add theme text color config options#12438
Merged
mayagbarnes merged 8 commits intodevelopfrom Sep 8, 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
This PR adds configurable text color options for theming, allowing users to customize text colors for red, orange, yellow, blue, green, violet, and gray themed elements. The text colors follow a smart fallback hierarchy: explicit text color configuration takes precedence, followed by derivation from main colors (darkened by 15% for light theme, lightened by 15% for dark theme), and finally falling back to defaults.
- Adds seven new text color configuration options for both main theme and sidebar
- Implements smart fallback logic that derives text colors from main colors when explicit text colors aren't provided
- Updates protobuf definitions, configuration system, theme utilities, and comprehensive test coverage
Reviewed Changes
Copilot reviewed 11 out of 20 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| proto/streamlit/proto/NewSession.proto | Adds protobuf fields for the seven new text color configuration options |
| lib/streamlit/config.py | Defines configuration options for all text colors with detailed documentation |
| lib/tests/streamlit/runtime/app_session_test.py | Updates test mocks and assertions to include new text color fields |
| lib/tests/streamlit/proto_compatibility_test.py | Adds protobuf compatibility tests for new text color fields |
| lib/tests/streamlit/config_test.py | Comprehensive config tests for text color options |
| frontend/lib/src/theme/utils.ts | Implements text color resolution logic and integrates it into theme creation |
| frontend/lib/src/theme/utils.test.ts | Extensive unit tests covering text color functionality |
| e2e_playwright/theming/custom_text_colors_test.py | E2E test configuration and execution for text color theming |
| e2e_playwright/theming/custom_text_colors.py | E2E test app demonstrating text color usage across various elements |
| e2e_playwright/theming/custom_main_colors_test.py | Updates comment to reflect that main colors now derive both background and text colors |
| e2e_playwright/theming/custom_background_colors_test.py | Updates comment to note text color derivation from main colors |
sfc-gh-lmasuch
approved these changes
Sep 8, 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 text colors for theming:
redTextColororangeTextColoryellowTextColorblueTextColorgreenTextColorvioletTextColorgrayTextColorOrder of precedence:
redTextColorredTextColor, derives it from a providedredColor(darkened by 15% for light theme and lightened by 15% for dark theme)Testing Plan