Plotly default buttons dark theme

Hi @AnnMarieW,

I am using your theme_switch with SwitchAIO and it’s working great. Thanks for your contribution. I recently added “classic” or default plotly buttons on my plots. However, while the there switch works on plot itself it does nothing to the button when going for dark theme (i.e. darkly). The selected button by default gets highlighted also which makes things even less nice.

Any workaround for this maybe that I could use with dark theme?

HI @davzup89
Do you mean the buttons integrated with the plotly charts, rather than using html.Button or dbc.Button in dash?
If so, is there a reason you want to do it that way?

I’ve never tried to style those buttons, but if you can inspect the element in the browser and find the class name, you might be able to apply some css. The other thing to try is a plotly template. Does setting template="plotly_dark" in the figure layout give the buttons a dark theme?

Yes, I mean those. If you try to toggle to dark theme on official website the same happens (Custom buttons in Python). In dark theme buttons are still highlighted when first clicked on. After second click on same button the highlight is removed. Is it possible to some turn off highlight behavior?

I guess changing to dbc.Button is the way. What I like with integrated buttons is that there is no callback needed and I am assuming they eat away less computing resources.

Hi @davzup89

It looks like this is an open issue: Add an option to change the highlighting background color of `updatemenus` · Issue #1428 · plotly/plotly.js · GitHub

1 Like