36
Views
4
Comments
Switch between dark and light theme in PWA mobile application
Application Type
Mobile

Hi Community,
I have a requirement where we need to switch to dark theme in PWA mobile application.
So is there any way we can achieve this feature. Cause I have got no solution on this on any previous forum questions.

2024-01-04 09-21-21
Venkatesaiya

Hi @Sanji San ,
                 The way we develop Dark themes in a mobile application is similar to how it is done in a PWA (Progressive Web App) mobile application. Please refer to these Forge components for theming. 
1.mobile-theme-switcher-darklight
2.mobile-dark-theme

UserImage.jpg
Sanji San

Thank you Venkatesaiya for your reply, will check on this.

 

2025-07-22 10-30-27
Mandar Deshpande

Hi @Sanji San 

Since you're working with O11 mobile projects, the recommended approach would be:

  • Create your own lightweight theme service module
  • Use CSS variables
  • Persist preference in LocalStorage
  • Initialize theme in OnApplicationReady

This will be cleaner, have zero external dependency and future-proof.

2025-07-28 06-45-20
Rupesh Patil

Hi @Sanji San 

I have added below oml file you can check:

I hope this helps

Thanks

LightandDarkTheme.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.