Download and InstallDownload and install the asset into your OutSystems environment using Forge.
Consume the Web BlockIn the module where you want to detect the theme, consume the DetectTheme web block from the component.
DetectTheme
Place the BlockDrag and drop the DetectTheme block onto the screen or layout where theme detection is required.
Handle the Theme Change EventThe block exposes a Client Event named ThemeOnChange.
ThemeOnChange
This event provides a Boolean parameter: IsDark
IsDark
IsDark = True → Browser theme is Dark.
IsDark = True
IsDark = False → Browser theme is Light.
IsDark = False