Skip to content

Support import of CSS in SCSS #60

Open

Description

@vhristov5555

Nativescript 3.4.0
try to import a theme @import 'nativescript-theme-core/css/core.dark.css';
Actual: The theme is not going to be applied
The generated code will be:
@import url(/Users/vhristov/Downloads/NSPlayground/app/nativescript-theme-core/css/core.dark.css);

  • quotes are missing
  • it seems that the full path is not working

Activity

  1. radeva commented on Jan 5, 2018

    @radeva
    Contributor

    Hi @vhristov5555 ,

    Could you try to import the scss file instead of the css? I.e.:
    @import '~nativescript-theme-core/scss/dark'.

    Read more about SASS Usage in NativeScript documentation.

  2. vhristov5555 commented on Jan 5, 2018

    @vhristov5555
    Author

    Hi,

    Importing scss file is working @import '~nativescript-theme-core/scss/dark'.
    But in some cases you might want to import a css file.
    In case you decide to switch to scss from css or you want to use some existing css.

  3. radeva commented on Jan 5, 2018

    @radeva
    Contributor

    I'm marking support for importing css in scss as a feature.

  4. changed the title [-]Import of themes is not working correctly[/-] [+]Support import of CSS in SCSS[/+] on Jan 5, 2018
  5. bhavincb commented on Feb 22, 2018

    @bhavincb

    is there any workaround ?
    using @import '~nativescript-theme-core/css/dark' gives below error
    Error: File to import not found or unreadable: E:\nativescript\HelloWorld
    node_modules\nativescript-theme-core\css\dark.
    Parent style sheet: E:/nativescript/HelloWorld/app/app.scss
    on line 1 of app/app.scss

    any workaround available?

  6. T0T4R4 commented on Mar 22, 2018

    @T0T4R4

    this fails with the file not found error :
    @import '~nativescript-theme-core/scss/dark';

    this works but it is useless from within a scss file :
    @import '~nativescript-theme-core/css/dark.css';

    I am only working in scss so i need the first one to work.

  7. zbranzov commented on Apr 12, 2018

    @zbranzov
    Contributor

    @bhavincb @T0T4R4 The sample demo in the plugin's repo imports the light theme without any issues using your approach. Can you provide a demo that reproduces the issues you experience?
    Notice that v1.5.0 of the plugin has been released.

  8. bhavincb commented on Apr 13, 2018

    @bhavincb

    hii @zbranzov ,
    mine problem is solved by installing node-sass globally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions