VSCODE isn't recognizing config.toml

VSCODE isnā€™t recognizing config.toml, so the theme wasnā€™t applied.

VSCODE isnā€™t recognizing config.toml, so the theme wasnā€™t applied on my webapp, just a portfolio that I want to change to dark mode.

Debug info

  • Streamlit version: Streamlit, version 1.22.0
  • Python version: Python 3.10.11
  • Using Conda? PipEnv? PyEnv? Pex?: Iā€™m not using a venv, Itā€™s just a webpage.
  • OS version: Windows 10 pro
  • Browser version: Opera GX.

Links

What exactly do you mean by VS Code not recognizing you config file? I copied your config file into an app and got your blue theme displaying fine. (You are missing a hashtag on one of your hex colors, but that didnā€™t cause a parsing issue for me in Streamlit 1.21.0 at least.) It appears your files are named correctly and save correctly in relation to each other. If this was a deployed app on Streamlit Cloud, Iā€™d advise you to reboot your app since updates to the config file may not reflect after the app is already running.

However, I use VS Code too, and Iā€™ve never had trouble updating theme colors on the fly. I suppose your first try to should be to double check everything is saved then close your terminal and relaunch your app to be sure. Also, make sure you havenā€™t selected anything from the hamburger menu in the upper right to override the theme.

Have you tried any other browsers to confirm if it consistent elsewhere?

1 Like

Thanks for the answer.

ā€œWhat exactly do you mean by VS Code not recognizing you config file?ā€
I mean, my file didnā€™t get colored, you know? It looks like a simple .txt.
My .CSS file is like this:
image
And my .toml is like this:
image

Vscode isnā€™t recognizing the file?
Thereā€™s a config that I supposed to do before using .TOML?

If you tried my code and got it, the problem is my pc.

I tried to relaunch everything, but It didinā€™t work.

I was watching a tutorial about this one and the teacher just created the file out of vscode, in the folder. I tried doing this but didnā€™t work. He did this steps:

Right click > new > new text document and renamed the file to config.toml and got this:
image

When I did the same thing, got this:
image
it remains as .txt, so I created inside VSCODE and got this:
image
It changed from text document to toml font.

So I think my windowns need a config to accept TOML files, you know? Because Iā€™m importing others files to use, animation, style, pictures and It is working fine.

I see. Thatā€™s a VSCode configuration issue rather than anything to do with Streamlit.

It looks like there is no way to natively do that for toml files, so you will have to install an extension. It is discussed here with an option is given:

1 Like

Probably you have to turn off the annoying ā€œfeatureā€ in windows to hide file extensions.

https://www.autodesk.com/support/technical/article/caas/sfdcarticles/sfdcarticles/How-to-enable-hidden-file-extensions-in-Windows.html


There are vscode extensions for TOML files out there, for example:

2 Likes

I installed the extension and it works, now thereā€™s color in .toml.

I downloaded all files from the yt video to make sure thatā€™s something wrong with my windows and runned the his ā€œapp.pyā€ and didnā€™t work as well.

So, thereā€™s a problem with my PC.
I think thereā€™s nothing to do from here, so, thanks yā€™all.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.