When creating Plotly figures, you can specify the theme using the argument go.Figure(layout={"template": "plotly_dark"}). However, this is not dynamic and you must generate a new plot to update the plot's theme.
Is it be possible to specify the theme dynamically by using something like plotly.Figure(figure=fig, layout=("plotly_theme", {"template": "plotly_dark"})). This does not currently work (or even run), I tried multiple ways for dynamic theming.