Thanks!
This gave me control over the sidebar. However by doing this I realize that there is more to this than setting a dark background -> text, selectbox and other components need work.
I guess itâs better to wait for a supported dark theme at this pointâŠ
Thanks
Thank you for this workaround, @randyzwitch! This worked well on my streamlit v.0.71.0. However, I just tried updating my streamlit version to 0.72 and resulted in the background reverting back to the default color. Is there a new workaround or I should stick with 0.71 for now?
Thank you again for all the wonderful things that streamlit is doing!
As part of work towards formally supporting themes in Streamlit, weâve been re-factoring the codebase. So the CSS selectors will be changing. The quickest way to fix this would be to use your browserâs developer tools to find what .sidebar .sidebar-content changed to.
Iâll try to post the answer later today if I get a chance to do some coding today.
This is what I used to change sidebar colour for anyone interested. Thanks for the update @randyzwitch, looking forward to seeing how theme support looks!
I have done some experiments with manipulating the CSS however, I believe, it is better to wait for official support.
I tried to change the background colors and border of different elements from the âreddishâ default to something else, but after inputting some values, selecting items from a drop menu and so on, everything defaults to the original.
You should inspect the HTML code of your Streamlit App using your browser. In my case, full code for setting backgroung color of sidebar is:
st.markdown("""
You can easily change the sidebar color via theming nowadays. Just add the following text to your config file (in .streamlit/config.toml) to e.g. make the sidebar orange:
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking âAccept allâ, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.