Streamlit does not change theme with config.toml file

Hey
Fix this issue
on your current working directory check the hidden folder named ".streamlit " or you should create “.streamlit” folder name by command as follows,
$ mkdir .streamlit

what in default the system does is it creates a hidden file named .streamlit now need to change it like this

Then copy that file ‘config.toml’ inside this folder and restart the streamlit app

And it will work.

The problem is a combination of two factors:

  1. The hamburger menu selected theme has to be Custom for any theme or color settings in config.toml to be taken into account. If it’s “dark” or “light” the defaults are used.
  2. The theme selected from the hamburger menu is in local browser storage - so it survives even a reboot, let alone closing the browser.

#2 is clearly a feature, but for development, I think #1 is a bug at worst, or a very poorly documented “feature” at best. Because it’s a total boobytrap.

To test if this is your problem: simply open incognito mode or a different browser (where you haven’t touched the hamburger menu
To fix it: change back to custom as above, or delete the local storage from dev tools

I, for one, would like to see this treated as a doc or code bug.

2 Likes

I had issues finding the ‘.streamlit’ folder (e.g. path issues), but after a break the recommendation by @dataprofessor finally sunk in that it was higher up (‘Home’ folder), not in my ‘Streamlit’ apps folder. This thread was very helpful, thanks everyone all for your comments.

Minor consistency issue with Day 16 someone may want to ‘polish’ (st.title):

In the top part, ‘Code’ it says:
Streamlit 30 Days - 16a

But in the ‘Line by Line Explanation’ it says:
Streamlit 30 Days - 16b

Hi @mike_finko

Glad the issue was resolved and thanks for the suggested correction on the consistency of the st.title contents.