Title: .ns-dark doesn't apply through to dialogs · Issue #8484 · NativeScript/NativeScript · GitHub
Open Graph Title: .ns-dark doesn't apply through to dialogs · Issue #8484 · NativeScript/NativeScript
X Title: .ns-dark doesn't apply through to dialogs · Issue #8484 · NativeScript/NativeScript
Description: Environment From play.nativescript.org: { "@angular/animations": "8.2.14", "@angular/common": "8.2.14", "@angular/compiler": "8.2.14", "@angular/core": "8.2.14", "@angular/forms": "8.2.14", "@angular/platform-browser": "8.2.14", "@angula...
Open Graph Description: Environment From play.nativescript.org: { "@angular/animations": "8.2.14", "@angular/common": "8.2.14", "@angular/compiler": "8.2.14", "@angular/core": "8.2.14", "@angular/forms": "8.2.14", "@angul...
X Description: Environment From play.nativescript.org: { "@angular/animations": "8.2.14", "@angular/common": "8.2.14", "@angular/compiler": "8.2.14", &q...
Opengraph URL: https://github.com/NativeScript/NativeScript/issues/8484
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":".ns-dark doesn't apply through to dialogs","articleBody":"**Environment**\r\nFrom play.nativescript.org:\r\n```json\r\n{\r\n \"@angular/animations\": \"8.2.14\",\r\n \"@angular/common\": \"8.2.14\",\r\n \"@angular/compiler\": \"8.2.14\",\r\n \"@angular/core\": \"8.2.14\",\r\n \"@angular/forms\": \"8.2.14\",\r\n \"@angular/platform-browser\": \"8.2.14\",\r\n \"@angular/platform-browser-dynamic\": \"8.2.14\",\r\n \"@angular/router\": \"8.2.14\",\r\n \"@nativescript/angular\": \"8.21.0\",\r\n \"@nativescript/core\": \"6.5.0\",\r\n \"@nativescript/theme\": \"2.3.3\",\r\n \"@progress-nativechat/nativescript-nativechat\": \"3.0.0\",\r\n \"kinvey-nativescript-sdk\": \"4.2.5\",\r\n \"nativescript-accelerometer\": \"3.0.0\",\r\n \"nativescript-angular\": \"8.21.0\",\r\n \"nativescript-background-http\": \"4.2.1\",\r\n \"nativescript-camera\": \"4.5.0\",\r\n \"nativescript-geolocation\": \"5.1.0\",\r\n \"nativescript-image\": \"3.0.1\",\r\n \"nativescript-imagepicker\": \"7.1.0\",\r\n \"nativescript-intl\": \"3.0.0\",\r\n \"nativescript-iqkeyboardmanager\": \"1.5.1\",\r\n \"nativescript-social-share\": \"1.6.0\",\r\n \"nativescript-theme-core\": \"1.0.6\",\r\n \"nativescript-ui-autocomplete\": \"6.0.1\",\r\n \"nativescript-ui-calendar\": \"6.1.0\",\r\n \"nativescript-ui-chart\": \"7.1.1\",\r\n \"nativescript-ui-dataform\": \"6.0.0\",\r\n \"nativescript-ui-gauge\": \"6.0.0\",\r\n \"nativescript-ui-listview\": \"8.0.1\",\r\n \"nativescript-ui-sidedrawer\": \"8.0.0\",\r\n \"nativescript-vue\": \"2.5.0\",\r\n \"react\": \"16.13.0\",\r\n \"react-hot-loader\": \"4.12.20\",\r\n \"react-nativescript\": \"0.18.0\",\r\n \"reflect-metadata\": \"0.1.13\",\r\n \"rxjs\": \"6.5.4\",\r\n \"rxjs-compat\": \"6.5.4\",\r\n \"svelte\": \"3.20.1\",\r\n \"svelte-native\": \"0.8.1\",\r\n \"tns-core-modules\": \"6.5.0\",\r\n \"zone.js\": \"0.10.2\"\r\n}\r\n```\r\n\r\n**Describe the bug**\r\nLaunching a dialog from `@nativescript/core/ui/dialogs` pulls the colour from `Button`, but constructs one globally without attaching it to any context, so any extra styles are not applied appropriately. This includes component-local .css definitions for `Button`, but more importantly (for my use case), the `app.css` `.ns-dark Button` definition doesn't get used when the user is in dark mode.\r\n\r\nKeep in mind that the `Button` that is used for style extraction is only ever constructed once, too, which would disable the ability to switch back and forth between dark and light even if the style were properly composed at instantiation.\r\n\r\n**To Reproduce**\r\nAdd two styles:\r\n```css\r\nButton {\r\n color: #ff0000;\r\n}\r\n\r\n.ns-dark Button {\r\n color: #00ff00;\r\n}\r\n```\r\n\r\n**Expected behavior**\r\nWhen in Dark Mode, the buttons on a dialog should be green (in the example).\r\n\r\n**Sample project**\r\nhttps://play.nativescript.org/?template=play-ng\u0026id=Uklyzp","author":{"url":"https://github.com/facetious","@type":"Person","name":"facetious"},"datePublished":"2020-03-31T20:44:35.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/8484/NativeScript/issues/8484"}
| 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:a82dc221-6503-4454-d48b-9369e667a7e1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 936C:1E0C3E:1DE903C:2737818:6A5C8F2C |
| html-safe-nonce | 78655f82ea18e28fee1254a7d0227ce813cdd70a75a6dc32178a2562eb9e8900 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzZDOjFFMEMzRToxREU5MDNDOjI3Mzc4MTg6NkE1QzhGMkMiLCJ2aXNpdG9yX2lkIjoiNzI4MjkxNTUyNTIyNzQ4MjkyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f49e766456d3a82ef6a7986a59633917615eba73527acc6a780e517293473371 |
| hovercard-subject-tag | issue:591413974 |
| 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/NativeScript/8484/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9f56a9df00feca4be0c5103cfd6aa8d9a1c8cad395cbbffe7420d76eaace5d1c/NativeScript/NativeScript/issues/8484 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9f56a9df00feca4be0c5103cfd6aa8d9a1c8cad395cbbffe7420d76eaace5d1c/NativeScript/NativeScript/issues/8484 |
| og:image:alt | Environment From play.nativescript.org: { "@angular/animations": "8.2.14", "@angular/common": "8.2.14", "@angular/compiler": "8.2.14", "@angular/core": "8.2.14", "@angular/forms": "8.2.14", "@angul... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | facetious |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/NativeScript git https://github.com/NativeScript/NativeScript.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 31492490 |
| octolytics-dimension-repository_nwo | NativeScript/NativeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31492490 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/NativeScript |
| 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 | 9c975978430e9ad293956f2bbdaf153b1bd84a99 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width