Skip to content

Add main theme color config options#12288

Merged
mayagbarnes merged 14 commits intodevelopfrom
main-theme-colors
Aug 28, 2025
Merged

Add main theme color config options#12288
mayagbarnes merged 14 commits intodevelopfrom
main-theme-colors

Conversation

@mayagbarnes
Copy link
Copy Markdown
Collaborator

@mayagbarnes mayagbarnes commented Aug 21, 2025

Describe your changes

Add configurable main colors for theming:

  • redColor
  • orangeColor
  • yellowColor
  • blueColor
  • greenColor
  • violetColor
  • grayColor

Testing Plan

  • JS Unit Tests: ✅
  • E2E Tests: ✅ Added / Snaps updated
  • Manual Testing: ✅

@mayagbarnes mayagbarnes added security-assessment-completed change:refactor PR contains code refactoring without behavior change impact:users PR changes affect end users labels Aug 21, 2025
@snyk-io
Copy link
Copy Markdown
Contributor

snyk-io bot commented Aug 21, 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 Aug 21, 2025

✅ PR preview is ready!

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

@mayagbarnes mayagbarnes changed the title [WIP] Add & apply default main theme colors [WIP] Add configurable/default main theme colors Aug 22, 2025
@mayagbarnes mayagbarnes changed the title [WIP] Add configurable/default main theme colors Add configurable/default main theme colors Aug 25, 2025
@mayagbarnes mayagbarnes changed the title Add configurable/default main theme colors Add configurable main theme colors Aug 27, 2025
@mayagbarnes mayagbarnes changed the title Add configurable main theme colors Add main theme color config options Aug 27, 2025
@mayagbarnes mayagbarnes marked this pull request as ready for review August 27, 2025 23:37
@mayagbarnes mayagbarnes requested a review from a team as a code owner August 27, 2025 23:37
@sfc-gh-lmasuch sfc-gh-lmasuch requested a review from Copilot August 28, 2025 09:46
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 seven new configurable main theme color options to Streamlit's theming system. These colors can be customized for both the main application and sidebar, providing developers with greater control over their app's visual appearance.

  • Adds seven new color configuration options: red, orange, yellow, blue, green, violet, and gray
  • Updates theme processing logic to handle the new main color configurations
  • Includes comprehensive test coverage for the new color options

Reviewed Changes

Copilot reviewed 9 out of 12 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
proto/streamlit/proto/NewSession.proto Adds protobuf definitions for the seven new color fields
lib/streamlit/config.py Defines the new theme color configuration options with descriptions
frontend/lib/src/theme/utils.ts Updates theme creation logic to apply the new main colors
frontend/lib/src/theme/utils.test.ts Adds comprehensive unit tests for main color functionality
lib/tests/streamlit/runtime/app_session_test.py Updates session tests to include new color configurations
lib/tests/streamlit/proto_compatibility_test.py Updates proto compatibility tests for new fields
lib/tests/streamlit/config_test.py Adds configuration tests for the new color options
e2e_playwright/theming/custom_main_colors.py Creates test app demonstrating custom main colors
e2e_playwright/theming/custom_main_colors_test.py Adds E2E test with custom theme color configuration

"redColor",
categories=["theme", CustomThemeCategories.SIDEBAR],
description="""
Color used as main red color.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In case we derive the background and text color from the main color, we should probably mention it here as well. But I assume that's probably part of a follow-up PR.

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 c02c608 into develop Aug 28, 2025
36 of 37 checks passed
@mayagbarnes mayagbarnes deleted the main-theme-colors branch August 28, 2025 17:16
@mayagbarnes mayagbarnes added change:feature PR contains new feature or enhancement implementation and removed change:refactor PR contains code refactoring without behavior change labels Sep 2, 2025
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