# Dark Mode Indicator

**URL:** https://community.glideapps.com/t/dark-mode-indicator/73913
**Category:** Feature Requests
**Created:** [June 6, 2024, 3:45am UTC](https://community.glideapps.com/t/dark-mode-indicator/73913 "2024-06-06T03:45:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![J\_Ceja\_Jr](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/j_ceja_jr/32/74855_2.png) [@J\_Ceja\_Jr](https://community.glideapps.com/u/J_Ceja_Jr)
#### Post date: [June 6, 2024, 3:45am UTC](https://community.glideapps.com/t/dark-mode-indicator/73913/1 "2024-06-06T03:45:30Z")

</div>

Can Glide create an experimental column that simply displays a read-only boolean check box if dark mode is on? This would be helpful so that gliders can create if/then statements and filters based on that to control certain components when it changes from light to dark mode.  
I think someone has asked for a switch in the past but this wouldn’t be controlled by user input. If anyone has a workaround, please let me know!

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [June 6, 2024, 12:54pm UTC](https://community.glideapps.com/t/dark-mode-indicator/73913/2 "2024-06-06T12:54:01Z")

</div>

Add the following in a javascript column. To ensure that the value updates if a user changes their theme after the app is opened, add the current time as a parameter. This will be enough for the code to trigger every ten seconds and check the device theme.

```auto
function isDarkMode() {
    return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
}

if (isDarkMode()) {
    return true;
} else {
    return false;
}

```

 ![Screenshot_20240606-075021](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/7/47e4d31c3c54431f62846576b4c41a3957784c75.png)
