# DarkMode to custom HTML

**URL:** <https://forums.losant.com/t/darkmode-to-custom-html/4444>\
**Category:** Feature Request\
**Created:** [April 6, 2022, 11:44am UTC](https://forums.losant.com/t/darkmode-to-custom-html/4444 "2022-04-06T11:44:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Calderon](https://avatars.discourse-cdn.com/v4/letter/j/ecccb3/32.png) [@Jonathan\_Calderon](https://forums.losant.com/u/Jonathan_Calderon)\
**Post date:** [April 6, 2022, 11:44am UTC](https://forums.losant.com/t/darkmode-to-custom-html/4444/1 "2022-04-06T11:44:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [April 6, 2022, 1:36pm UTC](https://forums.losant.com/t/darkmode-to-custom-html/4444/2 "2022-04-06T13:36:14Z")

</div>

@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)

 ![Screen Shot 2022-04-06 at 9.31.44 AM](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/6/67a6fc861482694c0bda57fbb0c872c9a4e58852.png)
