Title: App is changing from Light to Dark Theme after Webpack HMR · Issue #289 · NativeScript/theme · GitHub
Open Graph Title: App is changing from Light to Dark Theme after Webpack HMR · Issue #289 · NativeScript/theme
X Title: App is changing from Light to Dark Theme after Webpack HMR · Issue #289 · NativeScript/theme
Description: Environment 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 o...
Open Graph Description: Environment 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 l...
X Description: Environment 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 l...
Opengraph URL: https://github.com/NativeScript/theme/issues/289
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"App is changing from Light to Dark Theme after Webpack HMR","articleBody":"**Environment**\r\n\r\n\r\n**Describe the bug**\r\nI 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.\r\n\r\n**To Reproduce**\r\n1. Turn dark mode on in the phone settings\r\n2. `ns debug android` on my connected Pixel 5 (Android 11)\r\n3. Change text in a component to trigger HMR\r\n4. App reloads and appears in the dark theme\r\n\r\n\r\n\r\n**Expected behavior**\r\nDark mode should remain disabled and the ns-dark theme should not apply.\r\n\r\n**Additional context**\r\nI have tried the following to ensure dark mode does not apply, none prevent the app from changing from light to dark on HMR.\r\n\r\n1. Setting `\u003citem name=\"android:forceDarkAllowed\"\u003efalse\u003c/item`\u003e in `styles.xml (values-v29)`\r\n2. Annotating class=\"ns-light\" on `\u003cpage-router-outlet\u003e`\r\n3. Setting `Theme.setMode(Theme.Light);` manually on `ngOnInit` in the app component and main.ts\r\n4. Adding the following snipplet to force it to disable night mode in main.ts\r\n```\r\nif (android) {\r\n on(launchEvent, (args: ApplicationEventData) =\u003e {\r\n androidx.appcompat.app.AppCompatDelegate.setDefaultNightMode(androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_NO);\r\n });\r\n}\r\n```\r\n","author":{"url":"https://github.com/Tyler-V","@type":"Person","name":"Tyler-V"},"datePublished":"2021-02-17T15:10:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":16},"url":"https://github.com/289/theme/issues/289"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ca0fdc25-3261-ea51-c3c0-60d825d3820a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8CEC:26BD66:21724:300C1:6A61F685 |
| html-safe-nonce | 9e85a4c01424fd390b7e2579ac4ae922c847d7488436b3373b803ff51723f01b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Q0VDOjI2QkQ2NjoyMTcyNDozMDBDMTo2QTYxRjY4NSIsInZpc2l0b3JfaWQiOiI4MDkwNDQzMzY2Mjc3NDQ1MjUzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 4f236243bca0228741bdb5331e33392b9d2f32b1b38dd5d49755a91e3d266182 |
| hovercard-subject-tag | issue:810269963 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NativeScript/theme/289/issue_layout |
| twitter:image | https://opengraph.githubassets.com/94a618eca23d836bedc19ee35d7b677ab1ac3c09c424e022e8d49ea64441acae/NativeScript/theme/issues/289 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/94a618eca23d836bedc19ee35d7b677ab1ac3c09c424e022e8d49ea64441acae/NativeScript/theme/issues/289 |
| og:image:alt | Environment 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 l... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Tyler-V |
| hostname | github.com |
| expected-hostname | github.com |
| None | d88d9dd41cd32712dc23ff01ba406271c88c4858198430c255d591be42a1166f |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/theme git https://github.com/NativeScript/theme.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 64524068 |
| octolytics-dimension-repository_nwo | NativeScript/theme |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 64524068 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/theme |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a7f024eda6b8ce06d29c9276168423bfe05bafae |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width