Skip to content

Add theme text color config options#12438

Merged
mayagbarnes merged 8 commits intodevelopfrom
config-text-colors
Sep 8, 2025
Merged

Add theme text color config options#12438
mayagbarnes merged 8 commits intodevelopfrom
config-text-colors

Conversation

@mayagbarnes
Copy link
Copy Markdown
Collaborator

@mayagbarnes mayagbarnes commented Sep 5, 2025

Describe your changes

Add configurable text colors for theming:

  • redTextColor
  • orangeTextColor
  • yellowTextColor
  • blueTextColor
  • greenTextColor
  • violetTextColor
  • grayTextColor

Order of precedence:

  • Uses configured redTextColor
  • If there is no configured redTextColor, derives it from a provided redColor (darkened by 15% for light theme and lightened by 15% for dark theme)
  • If neither, falls back to default

Testing Plan

  • Unit Tests (JS and/or Python): ✅
  • E2E Tests: ✅
  • Manual Testing: ✅

@mayagbarnes mayagbarnes added security-assessment-completed change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users labels Sep 5, 2025
@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io bot commented Sep 5, 2025

🎉 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)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 5, 2025

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-12438/streamlit-1.49.1-py3-none-any.whl
🕹️ Preview app pr-12438.streamlit.app (☁️ Deploy here if not accessible)

@mayagbarnes mayagbarnes changed the title [WIP] Add theme text color config options Add theme text color config options Sep 6, 2025
@mayagbarnes mayagbarnes marked this pull request as ready for review September 6, 2025 00:57
@mayagbarnes mayagbarnes requested a review from a team as a code owner September 6, 2025 00:57
@mayagbarnes mayagbarnes requested a review from Copilot September 6, 2025 00:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@mayagbarnes mayagbarnes merged commit ac4b231 into develop Sep 8, 2025
37 checks passed
@mayagbarnes mayagbarnes deleted the config-text-colors branch September 8, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:feature PR contains new feature or enhancement implementation impact:users PR changes affect end users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants