TeamMaestro / angular-native-seed

Build web apps and NativeScript applications from one codebase using the AngularCLI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use specific CSS

makeAdance opened this issue · comments

Hi.
I would like to know the following:
What is the right approach of specific CSS usage?
How can I define specific ios/android CSS files in the angular components?

Thanks.

You don't change anything in the angular component. You simple apply a new file name, just like you do through the regular {N} projects.

example.component.tns.android.scss
example.component.tns.ios.scss

Referenced here: https://github.com/TeamMaestro/angular-native-seed/blob/master/nativescript/gulpfile.js#L63

So i can have the following structure in a component:

  1. example.component.tns.scss --> for both ios/android
  2. example.component.tns.android.scss --> additional to 1) for specific ios scss
  3. example.component.tns.android.scss --> additional to 1) for specific android scss
    ??

And global definitions would be defined in:
nativescript/app/app.ios.scss
nativescript/app/app.android.scss
??

Thanks.

No. It's going to be the same way the core {N} behaves. Which is you need to create a common file between the platforms and import that into each platform-specific scss.

_example.scss

example.component.tns.android.scss

@import 'example';

Sorry; my mistake. I get it. Thank you.