How to build an unique button in streamlit web program?

Quick and dirty:

import streamlit as st

m = st.markdown("""
<style>
div.stButton > button:first-child {
    background-color: rgb(204, 49, 49);
}
</style>""", unsafe_allow_html=True)

b = st.button("test")

More elegant solution is as @andfanilo did by reading the css file and inserting the contents into the style tag.

3 Likes