nativescript-dev-sass icon indicating copy to clipboard operation
nativescript-dev-sass copied to clipboard

Support import of CSS in SCSS

Open vhristov5555 opened this issue 7 years ago • 7 comments

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

vhristov5555 avatar Jan 04 '18 13:01 vhristov5555

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.

radeva avatar Jan 05 '18 13:01 radeva

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.

vhristov5555 avatar Jan 05 '18 15:01 vhristov5555

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

radeva avatar Jan 05 '18 15:01 radeva

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?

bhavincb avatar Feb 22 '18 08:02 bhavincb

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.

T0T4R4 avatar Mar 22 '18 05:03 T0T4R4

@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.

zbranzov avatar Apr 12 '18 07:04 zbranzov

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

bhavincb avatar Apr 13 '18 04:04 bhavincb