Prevent forced dark mode on mobile

Hi everyone!

I’ve implemented a native Light/Dark mode in my WeWeb app using variables (based on globalContext.browser?.['theme']). It works perfectly on desktop and in the editor.

However, on many Android devices (especially using Chrome and Samsung Internet), the browser’s “Force Dark Mode” feature is overriding my custom UI. Instead of using my dark theme colors, the browser applies its own aggressive color inversion, turning whites into blue/navy tints and messing up the contrast of my elements.

Has anyone found a definitive way to tell mobile browsers to stop applying their own dark mode filters and strictly follow the app’s CSS? Is there a specific WeWeb setting or a more robust boilerplate for the Custom HTML to handle this?

Thanks in advance!

Ha! Great question! My guess is you’ll need to add some custom code to add instructions that force the browser to use the set theme. Let me ask the tech team and get back to you on this one.

Thanks for looking into that! I’ll be looking forward to hearing what the tech team says. This fix is quite important for my project, so I’m eager to get it sorted. If there’s anything you need me to do or test on my end, just let me know!