-
Notifications
You must be signed in to change notification settings - Fork 4.2k
unsafe_allow_html not behaving as expected to set text color #247
Copy link
Copy link
Closed
Labels
type:bugSomething isn't working as expectedSomething isn't working as expected
Description
Summary
In response to this issue, I was trying to get colored text to work using unsafe_allow_html, but it wasn't working as expected.
Steps to reproduce
Run this code:
import streamlit as st
colors = ['red', 'orange', 'yellow', 'green', 'blue', 'purple']
for color in colors:
st.write('<span style="color:%s">%s</span>' % (color, color), unsafe_allow_html=True)Behavior
Actual behavior
I don't see colors.
Expected behavior
I would've liked to see a nicely colored list of color names.
Debug info
$ streamlit version && python --version && pyenv --version && sw_vers && "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --version
Streamlit, version 0.47.2
Python 3.6.3
pyenv 1.2.3
ProductName: Mac OS X
ProductVersion: 10.14.6
BuildVersion: 18G95
Google Chrome 77.0.3865.90
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type:bugSomething isn't working as expectedSomething isn't working as expected
