Title: Add CSS classes to root views to target platform/device/orientation/modals · Issue #7313 · NativeScript/NativeScript · GitHub
Open Graph Title: Add CSS classes to root views to target platform/device/orientation/modals · Issue #7313 · NativeScript/NativeScript
X Title: Add CSS classes to root views to target platform/device/orientation/modals · Issue #7313 · NativeScript/NativeScript
Description: Describe the solution you'd like This came up as a request from @bundyo based on the re-work of the NativeScript theme. The idea is to add a CSS class to the root view of the application for specific states. This would allow much more fl...
Open Graph Description: Describe the solution you'd like This came up as a request from @bundyo based on the re-work of the NativeScript theme. The idea is to add a CSS class to the root view of the application for specif...
X Description: Describe the solution you'd like This came up as a request from @bundyo based on the re-work of the NativeScript theme. The idea is to add a CSS class to the root view of the application for sp...
Opengraph URL: https://github.com/NativeScript/NativeScript/issues/7313
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add CSS classes to root views to target platform/device/orientation/modals","articleBody":"**Describe the solution you'd like**\r\nThis came up as a request from @bundyo based on the re-work of the NativeScript theme. The idea is to add a CSS class to the root view of the application for specific states. This would allow much more flexible theming and styling. Here is a list for the app root view:\r\n\r\n- default\r\n - .ns-root\r\n- platform\r\n - .ns-ios\r\n - .ns-android\r\n- device type\r\n - .ns-phone\r\n - .ns-tablet\r\n- orientation\r\n - .ns-portrait\r\n - .ns-landscape\r\n- os theme mode (optional)\r\n - .ns-os-dark or .ns-dark\r\n - .ns-os-light or .ns-light\r\n\r\nWe should also add a class to the root view of any modal view\r\n- default\r\n - .ns-modal\r\n\r\n**Describe alternatives you've considered**\r\nThe alternative, which was used until now, is to have state specific files, e.g. app.android.css, app.ios.css, app.land.css. The problem with these is they can't be chained, there are no device type specific and modal ones (and don't work with webpack).\r\n\r\n**Additional Info**\r\nCSS Color Adjustment Module for Browsers (regarding dark/light mode in OS) - https://www.w3.org/TR/css-color-adjust-1/\r\n\r\n\u003cbountysource-plugin\u003e\r\n\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/75104912-add-css-classes-to-root-views-to-target-platform-device-orientation-modals?utm_campaign=plugin\u0026utm_content=tracker%2F12908224\u0026utm_medium=issues\u0026utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin\u0026utm_content=tracker%2F12908224\u0026utm_medium=issues\u0026utm_source=github).\r\n\u003c/bountysource-plugin\u003e","author":{"url":"https://github.com/MartoYankov","@type":"Person","name":"MartoYankov"},"datePublished":"2019-06-05T12:34:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/7313/NativeScript/issues/7313"}
| 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:ff651ef6-14db-a68c-1fd6-95cca5b6afbb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8322:1AD267:27ECB8F:371B6CF:6972A088 |
| html-safe-nonce | 03acfd214e467c807310f542d7d99b9909b5f605e1c52275d71f4c27225c0151 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MzIyOjFBRDI2NzoyN0VDQjhGOjM3MUI2Q0Y6Njk3MkEwODgiLCJ2aXNpdG9yX2lkIjoiNzMyMTE4ODI5MjMxOTQyMDU1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fd5b672d41410efd9831d853e131b8646a7a20adf635c8f438c6e551cc0a9df4 |
| hovercard-subject-tag | issue:452476028 |
| 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/7313/issue_layout |
| twitter:image | https://opengraph.githubassets.com/012626999627e692b5ddc43270a9d44d928ae40e593809377b068fe25210daf9/NativeScript/NativeScript/issues/7313 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/012626999627e692b5ddc43270a9d44d928ae40e593809377b068fe25210daf9/NativeScript/NativeScript/issues/7313 |
| og:image:alt | Describe the solution you'd like This came up as a request from @bundyo based on the re-work of the NativeScript theme. The idea is to add a CSS class to the root view of the application for specif... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MartoYankov |
| hostname | github.com |
| expected-hostname | github.com |
| None | 72bb1c46bb1ebdc0dc83a0a57b64c3b4d668c125d1125d94898213a4c9db8da2 |
| 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 | e746f1a3ddb5c0a91290ff3d5889b5247e0e519e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width