Search code examples
cssnativescriptangular2-nativescript

Unable to find stylesheets in multiples nativescript styleurls


I'm using nativescript-angular 1.2.0 and tns-core-modules 2.5.0.

Here my login.component.ts:

@Component({
  moduleId: module.id,
  selector: "myapp",
  templateUrl: "./login.component.html",
  styleUrls: ["./login.common.css", "./login-component.android.css"]
})

But while compiling it is unable to find login-component.android.css.

I've already remove, build, add etc.

I change the second css file multiple times, but there is a Bug, nativescript is unable to find the second stylesheet.


Solution

  • I think you should change login-component.android.css to login-component.css as that '.android' bit is resolved automatically on Android builds.

    Also, since you're using module: module.id you can drop the ./ so it becomes: styleUrls: ["login.common.css", "login-component.css"]

    And make sure the file is login-component, not login.component, etc.