-
-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
Describe the bug
I am trying to ensure the app remains in light mode. When I am debugging I set my phone settings to enable dark mode. I then debug the app and initially it appears in light mode however when webpack reloads on a change during development, it then appears to apply the dark theme.
To Reproduce
- Turn dark mode on in the phone settings
ns debug androidon my connected Pixel 5 (Android 11)- Change text in a component to trigger HMR
- App reloads and appears in the dark theme
Expected behavior
Dark mode should remain disabled and the ns-dark theme should not apply.
Additional context
I have tried the following to ensure dark mode does not apply, none prevent the app from changing from light to dark on HMR.
- Setting
<item name="android:forceDarkAllowed">false</item> instyles.xml (values-v29) - Annotating class="ns-light" on
<page-router-outlet> - Setting
Theme.setMode(Theme.Light);manually onngOnInitin the app component and main.ts - Adding the following snipplet to force it to disable night mode in main.ts
if (android) {
on(launchEvent, (args: ApplicationEventData) => {
androidx.appcompat.app.AppCompatDelegate.setDefaultNightMode(androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO);
});
}
Metadata
Metadata
Assignees
Labels
No labels

