I bow to your awesomness creating this tool. Presentation to my team later this week. QQ: is it possible to set the page background color (to black) and the text color (to white). Out team logo is on a black backgpound.
Thanks!
I bow to your awesomness creating this tool. Presentation to my team later this week. QQ: is it possible to set the page background color (to black) and the text color (to white). Out team logo is on a black backgpound.
Thanks!
Welcome to the Streamlit community and thank you for the kind words
We’ve had that come up a few times recently, and we’re considering different ways to support it. We want to make theming super easy, so the exact API may take a little time to land. Here’s a feature request you can follow/upvote/comment on!
In the meantime, some users have been hacking this together by passing a <style>
block into st.markdown
with unsafe_allow_html=True
. The problem with this is you’ll have to update a lot of styles to get things to look the way you want it .
Hope this helps and good luck on the presentation, we’d love to hear how it goes!
Give us the whole code
Hi @Tshokelo_Mokubi,
You’ll find an example of background color here and text color formatting here.
Best
Fanilo
Text color formatting is as simple as the following (using ‘red’ as an example):
Just delete both *'s inside the font blocks.
This code isn’t working can you please help
It really works!!! THANK YOU
You can easily do this via theming nowadays. Just add the following text to your config file (in .streamlit/config.toml
) to get black background and white text color:
[theme]
backgroundColor="#000000"
textColor="#ffffff"
There are also more options, see our theming docs. Btw, if you want to change the color of a small piece of text, you can use colored text in st.markdown
, see the docstring for body
.
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.
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.
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.
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.