DarkMode to custom HTML

Hi Losant Team.
I just want to say that it would be nice if you could add dark mode to custom HTML.
Thanks :slight_smile:

@Jonathan_Calderon we do expose the current dashboard theme in the block. When you add a new Custom HTML Block, you will see the property in place at the object property dashboard.theme. The value will be either “light” or “dark”. I’ve attached a screenshot.

We also emit an event to the block whenever the theme changes. I recommend reading the instructions at the bottom of the block configuration page, where we detail the properties we expose and the events we emit.

If what you are trying to do is set the background color of your block based on the selected theme, we use the following colors for block backgrounds:

  • light: rgb(245,246,247)
  • dark: rgb(41,49,65)