proper way to update widget style (such as font-size) ?
See original GitHub issueHello, I’ve noticed that since version 5.0 it is not possible to set style parameters such as ‘font-size’ with the following syntax
from ipywidgets import widgets
w=widgets.Text("example",font_size=75)
display(w)
neither this way:
from ipywidgets import widgets
w=widgets.Text("example")
w.font_size=75
display(w)
What is the proper way? I’ve found anything in the doc 😦
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:23 (11 by maintainers)
Top Results From Across the Web
How to increase the font size of a Text widget? - Tutorialspoint
To configure the text properties of the a widget, we can use the font('font-family font-size font-style) attribute by defining its font-family, ...
Read more >How to change a widget's font style without knowing the ...
There's a much better way than using .config() to change your application font, especially if your goal is to change the font for...
Read more >How to Change the Size and Style of Font in WordPress (NO ...
No plugin is needed either! I'll show you how to quickly and easily change the font size and style in your blog posts...
Read more >How to change Font Style of Text Widget - Flutter Campus
In this example, we are going to show the way to change style of font inside text widget such as font-weight, font size,...
Read more >How to Change Font Size of Widget Title? - ThemeGrill Docs
From your WordPress Dashboard, go to Appearance -> Customize -> Content -> Widgets · Scroll to Typography. · Change the font size of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@meyermj, @patrickhoebeke : I had the same problem. After studying what CSS is and how it works, I managed a hack:
Note that %%html is simply a wrapper around IPython.display.display_html. So it would be possible to create some kind of Pythonic (kernel-side) front-end that generates and displays the CSS. At the very least, one could use something less awkward than pure CSS (it appears that there are dialects with improved syntax, like SASS, which are pre-processed/compiled into CSS).
But, in addition, one could inform a smart (kernel-side) front-end about the internal DOM structure of the ipywidget.To my taste, this is a more flexible way to allow styling than the current method of exposing arbitrary attributes to the model-view-comm framework. But I am not really qualified to judge, since I know nothing about (browser-side) front-end development.
It does not seem possible to modify the font size or color of a Label or Text widget. How should this be accomplished?