Header Themes

I’ve been trying to create a stream-lit config file for theming. Is there a way to make separate text colors for headers and regular text? I’ve tried to use stream-lit’s text color formatting “:blue[this text is blue]” to manually change headers to yellow, but yellow as a specific color does not seem to be supported in this format.

Streamlit’s Markdown only supports a limited set of colors by default.
If the specific color you want, like you mentioned yellow, is not supported, you can try using HTML tags!

An example code can be done like below:

import streamlit as st

# Regular text with custom color using Streamlit's Markdown
st.markdown(":blue[This text is blue]")

# Regular text with custom color using HTML tag
st.markdown("<span style='color: yellow;'>This text is yellow</span>", unsafe_allow_html=True)

Hope this helps!

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