Skip to content

Theme selection (Light/Dark) does not persist across reloads in Streamlit 1.51 #13280

@marinang

Description

@marinang

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

In Streamlit 1.51, the user-selected theme (Light or Dark) from the Settings menu does not persist.
Any rerun or page refresh resets the app to the default theme.
This happens in multiple browsers (Chrome, Edge).

Reproducible Code Example

Steps To Reproduce

  1. Define custom themes in config.toml using:
[theme.light]
[theme.dark]
  1. Run a minimal app:
import streamlit as st
st.write(st.context.theme.type)
st.button("Rerun")
  1. In Settings → Theme, switch to Light or Dark.

  2. Trigger a rerun or refresh the page.

Expected Behavior

The chosen theme should persist across reruns and page reloads.

Current Behavior

The theme always resets to the default theme after each rerun or refresh.

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: 1.51.0, 1.52.1
  • Python version: 3.11
  • Operating System: Windows 11
  • Browser: Chrome, Edge

Additional Information

  • This regression did not occur in Streamlit 1.50.

  • Affects both default and custom light/dark themes.

Metadata

Metadata

Assignees

Labels

feature:configRelated to `config.toml` and config optionsfeature:themingRelated to themingpriority:P2Medium-high priority - fix within one monthstatus:confirmedBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expectedtype:regressionThis bug is a regression from previous behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions