I see 3 ways of doing what you want. The 3rd way does exactly what you want but is more hacky that the 2 first.
Theming with .streamlit/config.toml
Use theming options via config file. You can see more details in the Streamlit docs about theming.
Modify ~/.streamlit/config.toml
to include:
[theme]
primaryColor="blue"
Then, go on your Streamlit app, and click on the hamburger menu up right, then "Settings" > "Theme" and choose the "Custom Theme".
import streamlit as st
st.multiselect("Something", ["something1", "something2", "something3"])
st.checkbox("Enable autotune")
name = st.text_input("Enter your name")
st.markdown("Hello, {}!".format(name))
A downside is that it modifies every other widget color:
Theming via the Streamlit interface
Another way to do the same than the 1st proposition is to click on "Edit Active Theme" in the same menu as the first proposition.
Modify the css using css injection via st.markdown
A last way is to modify the style via markdown:
import streamlit as st
st.markdown(
"""
<style>
span[data-baseweb="tag"] {
background-color: blue !important;
}
</style>
""",
unsafe_allow_html=True,
)
st.multiselect("Something", ["something1", "something2", "something3"])
This one only modifies the choices colors of the st.multiselect
widget and not the other widgets colors.
!important
to be whatever you like. – Georgia