Hey guys, just looking for ways to customize the appearance of the streamlit app. I wanted to change the background color of the expander and also bg color of the profile icons when using chat_message.
@lkdd-ao your solution works really well thank you for the solution. Do you (or anyone else) know how I could get TWO different colors (i.e. one for the user and one for the other person/bot)? Using the your code, I can change the color of all messages, but not have them be user specific. The CSS changes both the User and the Assistant types.
if "username" == "Bob":
color = "black"
else:
color = "gray"
st.html(
f"""
<style>
div[data-testid="stChatMessage"] {{
background-color: {color};
}}
</style>
""")
Something like this also doesn’t work, it just sets all messages to be the one color. is there a way to make the st.html statement have two separate styles, one for each user?