Applying css of message() using "from streamlit_chat import message"

Hello, I’m using message() using “from streamlit_chat import message”. I’ve used “is_user=True” to separate messages, but I’ve used css to adjust the color of the message box or the size of the text, but it doesn’t work. Can I know what to do?

(Additional Updates)
If I wanted to distinguish the messages on the left and the right by color, I confirmed that they were applied through developer mode. However, I wrote and executed the source code at the bottom, but the CSS was not reflected. Can you get the cause and solution?

import streamlit as st
from streamlit_chat import message

st.markdown(
    """
    <style>
        .css-1meupwp > div{
            background: orange;
        }
    </style>
    """,
    unsafe_allow_html=True
)

message("Hello")
message("User message",is_user=True)
1 Like

Hi @dskang207,

Thanks for sharing your question with the community! :balloon: Please update your debugging post to include a code snippet and a link to your app’s public GitHub repo – this will allow the community to help you find an answer as quickly as possible. In the meantime, this post will be tagged as needs-more-info.

I’m sorry, but the confirmation was late. I wrote additional data about my situation. I’d appreciate it if you could give me a solution.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.