Streamlit does not change theme with config.toml file


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:

I have tried the following and did not work

Also tried the following and nothing:


Hi @christian_heins,

Can you check that your .streamlit (which contains config.toml) folder is in the same directory as the Streamlit

Please consider the following directory structure:

├─ .streamlit
│  └─ config.toml
├─ packages.txt
├─ requirements.txt

Best regards,

Hi chanin!

Thank you for the quick response, as you can see from the screen shots I am having the suggested structure already.

├─ .streamlit
│ └─ config.toml
├─ requirements.txt

Screenshot 2023-04-16 at 15.27.44


The directory structure looks right and the content of config.toml looks good. Can you check to see if the quotation marks in the config.toml is not the curly quotation marks which may come from copy-pasting contents from web browsers.

Or also try downloading this config.toml from the Streamlit app-starter-kit.

Best regards,

Hi chanin,

I tried replacing the config.toml in my app with the one you provided, still no success.

My app config.toml file:
Screenshot 2023-04-17 at 08.56.17

Nevertheless I deployed a new app using the app starter kit template, and it works perfectly. I changed the background color to bright yellow to check the result.

Template config.toml file:

I am guessing this might be then a conflict in my code? I am experiencing a similar problem here same with the page names, when using show pages. The names change only for a while, and after a while the page names return to the file names.

page_real_estate_general_dashboard = ""
page_maps = "pages/"

        Page(page_real_estate_general_dashboard, 'General Dashboard', "🏠"),
        Page(page_maps, 'Maps', "🗺️"),


I decided to change the main app name from “” which is my project name to “” and all works like a charm (I had to delete the app and redeploy it, since the main file name changed), the show pages problem thing still persist, my page name are not being picked correctly.

Somewhere inside the config.toml methodolgy - process the app looks for this specific name “” and no other file name?

Not the case, fortunately. As mentioned in Configuration:

If changes to .streamlit/config.toml are made while the app is running, the server needs to be restarted for changes to be reflected in the app.

Instead of renaming your main script and redeploying the app, rebooting the app (on Community Cloud) or restarting the app would have also worked.

I have other apps where the main app name is different to “” and the theme is still not being picked up. This change here worked for me. I will test changing the file name to “” In the other apps as well.


I tried rebooting the app, but since the main file name changed from “” to “”. I had to delete the app and redeploy as new to set the new main file path to “”.

For me the the issue was already when I ran locally. It had worked perfectly with my config file, until yesterday when it just didn’t.

What I had done a few days ago was show off the “theme function” to a colleague. I had then manually pressed the hamburger menu (on localhost:8501) → Settings and chosen Light theme instead of my usual Custom Theme. Apparently, I just realized, this change persisted through multiple reruns, reloads, computer turned on and off and what not. I had to go back to my hamburger menu and choose Custom Theme again, and now my own theme is working perfectly.

Since this change persisted across so many reruns, there has to be some link or variable somewhere that is kept for future use (@streamlit-crew do explain :slight_smile:). That could also explain why changing names of the app makes it work again, as some of you did.
I haven’t tried deploying it with my accidental manual light theme settings, so I don’t know if that kept variable would follow to the cloud or not, but it might.
Hope this helps someone!


I understand, somewhere in the api the name get’s picked up,

the difference between these 2 apps, is the file, on the first one is called


On the second one, the blue theme get’s picked up and the initial state of the app is “light”, not “dark mode”.


This has also solved it for me. Thanks you!!

For me, the problem was that windows did not recognise my file as being a .toml file. Copying the credentioals.toml file from ~./streamlit and changing its name and contents to be a config.toml file fixed the issue.