Streamlit does not change theme with config.toml file

Summary

I have created a config.toml file in my streamlit project. Whenever I run my python file, the theme from the toml file doesn’t change in my app. I’m using pycharm as an IDE.

Steps to reproduce

My pycharm file list looks like this. Did I create the config.toml file correctly?
Screenshot 2022-10-26 at 14.22.16
Screenshot 2022-10-26 at 14.20.53
My config.toml file look like this.

How can I make sure that my python app uses the toml file?

Hi @jbaekelm, welcome to the community :wave:

From your screenshot it looks like you’ve misspelled the filename as congif.toml, instead of config.toml

Happy Streamlit-ing! :balloon:

Hi @snehankekre

Thank you for the quick reply. I have changed that. Still no improvement. I have looked with streamlit config show.

What can I do next?

Did you explicitely set the theme to “Custom theme” in the hamburger menu? Sometimes it doesn’t work by simply placing the .toml file in the .streamlit folder.
I find this very confusing as well. Would be better if the app itself could enforce to use the custom theme if available through st.set_page_config.

1 Like

Where are you running streamlit config show from? If you are running it from inside the app folder, then it won’t pick up on the .streamlit folder, and so will ignore the config.toml file. If you are running it from the top level folder it should recognize and use the config file.

Also, what version of streamlit are you using?

Hello, I have the same issue.

I created a config.toml file in a .streamlit folder, itself in my app/root folder. I changed the base theme to “dark” but it does not apply.

1 Like

Hi Pat! Your file shows that the base = "dark" line is commented out. Try removing the # prefix on that line. :slightly_smiling_face:

1 Like

oh Gee!.. beginner’s mistake :upside_down_face:… Thanks a lot @mathcatsand. Next time, I will double-check before posting something. :confused: