I was hoping for a much more expansive list of supported colors:
blue, green, orange, red, violet.
I can see plenty of reasons why you would want to KISS on this feature, but for someone like me who is strongly interested in colors as an aspect of design, this is a painfully limited palette. My publishing company has its own custom colors that it uses wherever possible. I’d like to be able to choose from a roster of websafe colors (imagemagick has ~500 IIRC) or, even better, to define my own colors (“Nimble Blue”, which I use for most of my book covers, is 0,0,102…).
As a compromise can I suggest opening up an experimental or even undocumented feature that allows defining, importing, and saving sets of colors. I realize that you would want to provide some pretty sturdy disclaimers about the havoc a poorly chosen text color can wreak on readability!
Hey @fredzannarbor, thanks for the feedback! 100% understand that this is limiting for design-savvy people It’s a first version, and we’ll definitely do improvements in the future.
Now, as you already said, supporting completely arbitrary colors is a tricky thing. It’s cool for people like you but can lead to really bad apps for people who are not very familiar with design. We plan to do a bigger project next year to look into how we can support such visual customizations in a more general way where people don’t shoot themselves in the foot.
For now, you can always use HTML to hack arbitrary colors:
st.markdown(
"This is <span style='color: #123456'>an arbitrary color</span>",
unsafe_allow_html=True
)
@fredzannarbor since we are kicking off a bigger project to expand what you can do design wise - do you have other ideas on features you’d love to see? Also would love to know more about the apps that you’re creating and why visual customization is important to you!
Any chance that access to adding css classes/ids is included in that project? GitHub FR
One of my pain points is control over how columns flex. This includes not being able to put columns inside columns as well as being forced into “all or one”. It would be nice to have the option to control how things flex, preferring a progressive reduction: fives columns, four columns, three columns, …as you reduce the width. For this I would almost imagine a different element than columns as the use case typically involves me iterating through a list to distribute elements to the columns. Perhaps an st.flex_grid element to which we can pass a list of objects would be good?
feature idea:
I’m not sure if I will use the colored texts, but if I do I would like to have access to the colors from the Theme settings. (I realize that only the Primary color makes sense).
st.markdown(”This text is :themed[colored primary_color].”)
that would keep the app consistent when playing arround with the themes as there are no “fixed” colors that clash with e.g. a dark theme.
maybe an additional “highlighting color” in the theme would make sense.
Why customisation is important? (for me)
when writing apps for different colleagues , all in the same field, all with streamlit they can look quite simmilar. After some time even the names can get quite simmilar. Therefore I like to give them different icons/emojis and change the theme-colors to distinguish them at a glance.
using company colors from corporate designs when a project has matured is always a plus when showing apps to managment/superiors.
Hi @snehankekre, almost all data widgets support coloured text in this Streamlit version. I think Checkbox got left out. Hope this is added in the next version.
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.