Plugin: variableSrv.dashboard.style always has the same value

Hi!

For our Grafana plugin we want to be able to detect the current theme and adjust our color scheme accordingly.

I found the key variableSrv.dashboard.style, but its value is always set to “dark”. If I recall correctly, variableSrv is not part of the public API, so I understand if this is something you won’t fix.

Is there another way of getting the current theme from within a plugin?

Thanks!

You can get it like this: Grafana templating by logged in user

Here is an example from the Bubble Chart plugin: https://github.com/digrich/bubblechart-panel/blob/master/src/bubble_ctrl.js#L176