You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Theme switching is a very common use case. Because of this bug, modebar buttons can become nearly invisible after switching from a light theme to a dark theme.
Modebar button hover colors do not update correctly when layout.modebar.color or layout.modebar.activecolor changes after the plot has already been rendered.
For example, when switching a plot between light and dark themes:
Render the plot in the light theme.
Update layout.modebar.color and layout.modebar.activecolor to the corresponding dark theme values.
The modebar initially appears correct with the updated colors.
Hover over any modebar button.
The hovered button uses the colors from the initial light-theme render instead of the current dark theme values.
The reverse also happens when the plot is initially rendered in the dark theme and then switched to the light theme.
In other words, the non-hover state updates correctly after the layout changes, but the hover state appears to retain the initial values of color and activecolor. layout.modebar.bgcolor appears to update correctly; the issue seems specific to color and activecolor.
This is also reproducible in Plotly's own examples when dynamically switching themes.
Expected behavior
Modebar buttons should use the latest values of layout.modebar.color and layout.modebar.activecolor after the layout is updated.
Hover over a modebar button while the page is in the light theme.
The hovered button becomes darker, as expected:
Switch the documentation site to the dark theme:
Return to the plot. Before hovering over the modebar buttons, the modebar colors appear correct for the dark theme:
Now, hover over the modebar buttons. The icon colors switch back to the stale values from the initial light theme render instead of using the current dark theme color and activecolor values!
The behavior can be seen clearly in this recording:
Description
Theme switching is a very common use case. Because of this bug, modebar buttons can become nearly invisible after switching from a light theme to a dark theme.
Modebar button hover colors do not update correctly when
layout.modebar.colororlayout.modebar.activecolorchanges after the plot has already been rendered.For example, when switching a plot between light and dark themes:
layout.modebar.colorandlayout.modebar.activecolorto the corresponding dark theme values.The reverse also happens when the plot is initially rendered in the dark theme and then switched to the light theme.
In other words, the non-hover state updates correctly after the layout changes, but the hover state appears to retain the initial values of
colorandactivecolor.layout.modebar.bgcolorappears to update correctly; the issue seems specific tocolorandactivecolor.This is also reproducible in Plotly's own examples when dynamically switching themes.
Expected behavior
Modebar buttons should use the latest values of
layout.modebar.colorandlayout.modebar.activecolorafter the layout is updated.Screenshots/Video
Steps to reproduce
The hovered button becomes darker, as expected:

Now, hover over the modebar buttons. The icon colors switch back to the stale values from the initial light theme render instead of using the current dark theme
colorandactivecolorvalues!The behavior can be seen clearly in this recording:
PixPin_2026-09-05_23-48-34.mp4