How can I make a toggle where the user can choose:
Light | Dark | Auto
where light or dark is the appearance of the PWA and ‘Auto’ follows system dark/light mode.
I have tried following the docs Dark Mode - Ionic Documentation but even doing document.body.classList.toggle('dark', false);
on ngOnInit
, or this.renderer.addClass(this.document.body, 'dark');
in a component does not work, thanks!
(My app.component.ts
defaults styles to iOS using IonicModule.forRoot({ mode: 'ios' }),
, not sure if this is of any relevance!)
1 post - 1 participant