Ionic Android is always showing dark mode error

Viewed 509

I've been creating a very small app with a menu some chips and a searchbar. But the problem is that I have forced MD theme in all app as you can see here:

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [
    BrowserModule,
    IonicModule.forRoot(
      {
        mode: 'md'
      }
    ),
    AppRoutingModule,
    HttpClientModule,
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: HttpLoaderFactory,
        deps: [HttpClient]
      }
    })
  ],
  providers: [
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
  ],
  bootstrap: [AppComponent],
})
export class AppModule { }

But in android it keeps seeing like this even android is Light Mode:

Android Screenshot (Click me)

So anyone knows why it is always displaying in dark mode and how to fix it? I want the mobile devices to switch from dark to light when system is in that mode not only dark.

1 Answers
  1. Open index.html in src folder in root of your project.
  2. Search with "light dark" and remove "dark" from the line.
  3. Open themes/variables.scss file and search dark.
  4. Remove the block that has "Dark".
  5. Restart the app and find the difference.
Related