How to detect if a private app is currently in light or dark mode. | Community
Skip to main content

How to detect if a private app is currently in light or dark mode.

  • May 16, 2025
  • 1 reply
  • 0 views

Jihoon11

Is there a way for a  private side-bar app to detect if the current agent UI is in light or dark mode?

Can we use Client.get to detect if the current agent is in dark or light mode?

Also, is there a way for the app to detect when the display changes from dark to light mode, such as through an event?

1 reply

Francis14
  • June 18, 2025
Hello 이지훈!
 
Regarding your questions, I want to let you know that there isn't a Zendesk API available to get or subscribe to the agent UI light/dark mode. Additionally, there isn't an official event to detect theme changes in the Zendesk UI within apps. However, you can use *prefers-color-scheme* in CSS/JS within your app iframe to detect the OS-level color scheme preference as a fallback. 
 
Lastly, while it is possible to detect Zendesk UI mode changes through DOM or CSS hacks, please keep in mind that this method is unsupported and can be a bit fragile.