Hi there,
I’d love to know if there’s a way to change the red “highlight” when you however over a button.
Thank you in advance for the support.
Hi there,
I’d love to know if there’s a way to change the red “highlight” when you however over a button.
Thank you in advance for the support.
I have the same question! Following this post.
Any update on this?
Haven’t found a way to do this yet, but I’ll definitely post once I figure this out… Also, any help would still be appreciated.
you can define any button appearance as you like:
replace the color code and you will get what you want.
import streamlit as st
st.markdown("""
div.stButton > button:first-child {
background-color: #00cc00;color:white;font-size:20px;height:3em;width:30em;border-radius:10px 10px 10px 10px;
}
.css-2trqyj:focus:not(:active) {
border-color: #ffffff;
box-shadow: none;
color: #ffffff;
background-color: #0066cc;
}
.css-2trqyj:focus:(:active) {
border-color: #ffffff;
box-shadow: none;
color: #ffffff;
background-color: #0066cc;
}
.css-2trqyj:focus:active){
background-color: #0066cc;
border-color: #ffffff;
box-shadow: none;
color: #ffffff;
background-color: #0066cc;
}
“”", unsafe_allow_html=True)
if st.button(“the notice you want to show”):
st.write(“content you want to tell”)
You can change this by setting the primary color of the app theme, which will affect button highlights and many other colors in a consistent way. To do that, just add the following text to your config file (in .streamlit/config.toml
), e.g. to set the primary color to blue:
[theme]
primaryColor="#1C83E1"
There are also more options, see our theming docs.
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.