Title: Common CSS not applying when specifying platform specific · Issue #149 · NativeScript/angular · GitHub
Open Graph Title: Common CSS not applying when specifying platform specific · Issue #149 · NativeScript/angular
X Title: Common CSS not applying when specifying platform specific · Issue #149 · NativeScript/angular
Description: Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): { "name": "stackblitz-nativescript-angular", "ma...
Open Graph Description: Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): { "name"...
X Description: Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): { "...
Opengraph URL: https://github.com/NativeScript/angular/issues/149
X: @github
Domain: Github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Common CSS not applying when specifying platform specific","articleBody":"**Environment**\nProvide version numbers for the following components (information can be retrieved by running `tns info` in your project folder or by inspecting the `package.json` of the project):\n```\n{\n \"name\": \"stackblitz-nativescript-angular\",\n \"main\": \"./src/main.ts\",\n \"version\": \"1.0.0\",\n \"private\": true,\n \"dependencies\": {\n \"@angular/animations\": \"~19.0.0\",\n \"@angular/common\": \"~19.0.0\",\n \"@angular/compiler\": \"~19.0.0\",\n \"@angular/core\": \"~19.0.0\",\n \"@angular/forms\": \"~19.0.0\",\n \"@angular/platform-browser\": \"~19.0.0\",\n \"@angular/platform-browser-dynamic\": \"~19.0.0\",\n \"@angular/router\": \"~19.0.0\",\n \"@nativescript/angular\": \"^19.0.0\",\n \"@nativescript/core\": \"~8.8.0\",\n \"rxjs\": \"~7.8.0\",\n \"zone.js\": \"~0.15.0\"\n },\n \"devDependencies\": {\n \"@angular-devkit/build-angular\": \"~19.0.0\",\n \"@angular/compiler-cli\": \"~19.0.0\",\n \"@nativescript/preview-cli\": \"^1.0.14\",\n \"@nativescript/stackblitz\": \"0.0.8\",\n \"@nativescript/tailwind\": \"^2.1.0\",\n \"@nativescript/types\": \"~8.8.0\",\n \"@nativescript/webpack\": \"~5.0.0\",\n \"@ngtools/webpack\": \"~19.0.0\",\n \"tailwindcss\": \"~3.4.0\",\n \"typescript\": \"~5.6.0\"\n }\n}\n```\n \n**Describe the bug**\nWhen adding platform specific css then the common.css is not being applied e.g: I have 3 css according to the docs: https://docs.nativescript.org/guide/styling#platform-specific-css\n\n**items.component.css**\n**items.component.ios.css**\n**items.component.android.css**\n\nWhen `items.component.css` is imported into the `items.component.android.css` then `items.component.css` rule aren't applied.\n\n**To Reproduce**\n\u003c!-- Add commands used or steps taken to reproduce the behaviour. --\u003e\nAdd 3 css \n\n**items.component.css**\n**items.component.ios.css**\n**items.component.android.css**\n\nAdd styleUrl: 'items.component.css', into items.component.ts\n\nUpdate items.component.html:\n\n```\n\u003cActionBar title=\"My App\"\u003e \u003c/ActionBar\u003e\n\n\u003cGridLayout rows=\"*,*\"\u003e\n \u003cLabel row=\"0\" text=\"Test\" class=\"test\"\u003e\u003c/Label\u003e\n \u003cListView row=\"1\" [items]=\"itemService.items()\"\u003e\n \u003cng-template let-item=\"item\"\u003e\n \u003cStackLayout [nsRouterLink]=\"['/item', item.id]\"\u003e\n \u003cLabel [text]=\"item.name\" class=\"text-lg text-gray-500 p-4\"\u003e\u003c/Label\u003e\n \u003c/StackLayout\u003e\n \u003c/ng-template\u003e\n \u003c/ListView\u003e\n\u003c/GridLayout\u003e\n```\nUpdate 3 css file each with different rules: \n\nitems.component.css \n```\n.test {\n text-transform: uppercase;\n}\n```\nitems.component.android.css\n\n```\n.test {\n color: purple;\n}\n```\nitems.component.ios.css\n```\n.test {\n color: green;\n}\n```\n\n**Expected behavior**\n\nExpect thar the items.component.css rule be applied for Test word be in Uppercase but only color changes in ios and android correctly.\n\n**Sample project**\n\u003c!-- If possible, provide a link from the [Playground](https://play.nativescript.org) with reproduction of the problem. If not, consider attaching a sample project or link to a repository with such project. --\u003e\n\n**Additional context**\n\u003c!-- Add any other context about the problem here. --\u003e\n\nWhat I noticed is that it prints this in the console: resolving \"/home/projects/nativescript-stackblitz-templates-7sgpxgkm/src/app/item/items.component.css\" to \"/home/projects/nativescript-stackblitz-templates-7sgpxgkm/src/app/item/items.component.android.css\"\n\nMore info on this video as well: https://www.youtube.com/watch?v=v5g6irUI704 \n","author":{"url":"https://github.com/lano-vargas","@type":"Person","name":"lano-vargas"},"datePublished":"2025-01-29T11:41:53.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/149/angular/issues/149"}
| 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:7722f993-90c5-e7e8-6c83-fe98f4afe8e2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AD10:3F9146:31C5F46:331A7F0:6A632641 |
| html-safe-nonce | 1ef2a61cd4c8b18c3754aa878055ebe0c46b66b6d8d99ec347acc435b86fe62a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDEwOjNGOTE0NjozMUM1RjQ2OjMzMUE3RjA6NkE2MzI2NDEiLCJ2aXNpdG9yX2lkIjoiMTE4OTIyNTQwNDY1NTkzNzA4OSIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9 |
| visitor-hmac | 2277b9157b4045839ce4d734227994c456131ae0112efa6c9fb678ee7e3b66ac |
| hovercard-subject-tag | issue:2817972275 |
| 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/angular/149/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e643535b4a4bf6541236de4c1bbd5e8959f3b532f715cfd57da49bb8e6ae4de8/NativeScript/angular/issues/149 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e643535b4a4bf6541236de4c1bbd5e8959f3b532f715cfd57da49bb8e6ae4de8/NativeScript/angular/issues/149 |
| og:image:alt | Environment Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project): { "name"... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lano-vargas |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1a6c056e02f174fffc096c521ec0ff6fb83e40a2ec8cb8875466ec1524872dd6 |
| turbo-cache-control | no-preview |
| go-import | github.com/NativeScript/angular git https://github.com/NativeScript/angular.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 302428305 |
| octolytics-dimension-repository_nwo | NativeScript/angular |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 302428305 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/angular |
| 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 | 6a93e25585f487ddff9e3996c06d5b869d6e1828 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width