Jensen Holm
Jensen Holm

Reputation: 63

Streamlit config.toml file not changing the theme of the web app

I would like to change the theme of my streamlit application that I am working on. I read that I should make a directory called .streamlit/ with a file called config.toml, after creating the .toml file, it does not update the appearance of my web application.

Here is the link to the app itself:

https://jensen-holm-sports-sim-app-app-4a49zi.streamlitapp.com/

Here is the code in my config.toml file that is not working

[theme]
base="dark"
primaryColor="#213767"
backgroundColor="#13710d"
font="monospace"

and a link to all of the code that is on git hub:

https://github.com/Jensen-holm/sports-sim-app

any help is appriciated!! thank you

Upvotes: 4

Views: 4150

Answers (1)

Ananda
Ananda

Reputation: 106

I just ran into the same problem. What I found out is that I had selected the "Dark" option via the hamburger menu at some point before creating the custom config file in the project directory. If you've done the same, the default order of precedence is overwritten and that choice is preserved. Otherwise, the default precedence should load the custom theme by default.

Solution was to select the "Custom Theme" again from the hamburger menu. On every run after that changes in the custom config were reflecting properly. In my app, I'm keeping the menu hidden but it still works fine once you have set the "Custom Theme" option - you can go back and re-hide the menu (if that's your need).

Upvotes: 6

Related Questions