question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting appropriate colors for dark theme seems not to be possible

See original GitHub issue

#710

Proposal: A base WidgetStyle class which is a widget like Layout, specialized for each widget type exposing higher level abstractions than css. For the SliderStyle object:

handle color slider color readout color we could limit this to colors at first…

Does not seem to work yet (ipywidgets.version = 7.0.0). I can only set the handle color. As I am working with a dark background style the default black readout color is very annoying… Or am I doing something wrong:

layout = {'width':'90%', 'height': '80px', 'border': 'solid', 'fontcolor':'red'}
style = {'handle_color': 'red', 'readout_color': 'red', 'slider_color': 'red'}
slides = widgets.interactive(lambda m, f: run(axes, lines, q, p, E, m, twopi*f, dt),
                            f=FloatSlider(min=1, max=100, step=1, continuous_update=False, layout=layout, style=style),
                            m=FloatSlider(min=1, max=100, step=1, continuous_update=False, layout=layout, style=style))

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
vks2005commented, Jan 3, 2021

A simple fix for all those using dark themes on jupyter notebook is to use following code. Just copy the code given below into a new cell and run it before the cells that create ipywidgets in your notebook.

`%%html

<style> .widget-readout{ color:white; } </style>`
0reactions
troelstkcommented, Jun 10, 2021

Experienced a similar problem using seaborn plots inside an widgets.Output() widget, where the area around the actual plot was greyed out. Solved it by running below code in a new cell first

%%html
<style>
.box_style{
    width:40%;
    border : 2px solid white;
    height: auto;
    background-color:white;
}
</style>

And setting the style for each box with a plot in it:

fig, ax = plt.subplots(figsize=(10, 10))
output = widgets.Output()
with output:
    ax.plot(x, y)
plot_widget = widgets.Box([output]) 
plot_widget.add_class("box_style")
Read more comments on GitHub >

github_iconTop Results From Across the Web

Turn on Dark theme & color inversion - Google Support
Open your device's Settings app . Select Accessibility. Under "Color and motion," turn on Dark theme. Turn on color inversion. Open your device's...
Read more >
Designing for Dark Mode Is More Than a Black Background
To be effective, a dark mode UX design should go beyond an inverted color palette. Here's how to enhance your interface using darker...
Read more >
A Complete Guide to Dark Mode on the Web - CSS-Tricks
Dark mode” is defined as a color scheme that uses light-colored text and other UI elements on a dark-colored background. Dark mode, dark...
Read more >
Dark Mode - Human Interface Guidelines - Apple Developer
Make sure full-color images and icons look good in both appearances. Use the same asset if it looks good in both light and...
Read more >
Dark theme - Material Design
A dark theme should avoid using saturated colors, as they don't pass WCAG's accessibility standard of at least 4.5:1 for body text against...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found