I am trying to modify the font attributes (weight, color, etc) of a jupyter label widget in python 2.7. As an example, I have tried the following:
import ipywidgets as widgets
myLabel= widgets.Label(value = 'Some Label',color = '#ff0000') #change font color to red
myLabel
When I run this bit of code, I get no errors, however the label color remains the default black.
There are 2 methods that I know of.
text = 'Some text'
htmlWidget = widgets.HTML(value = f"<b><font color='red'>{text}</b>")
labelWidget = widgets.Label(value = r'\(\color{red} {' + text + '}\)')
Update: and now with Ipyvuetify....
import ipyvuetify as v
text = 'Some text'
v.Html(tag="div", children=[text], style_ = "color: red; font-weight: bold")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With