Skip to content

Support import of CSS in SCSS #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vhristov5555 opened this issue Jan 4, 2018 · 7 comments
Open

Support import of CSS in SCSS #60

vhristov5555 opened this issue Jan 4, 2018 · 7 comments
Labels

Comments

@vhristov5555
Copy link

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
@radeva
Copy link
Contributor

radeva commented Jan 5, 2018

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.

@vhristov5555
Copy link
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.

@radeva
Copy link
Contributor

radeva commented Jan 5, 2018

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

@radeva radeva changed the title Import of themes is not working correctly Support import of CSS in SCSS Jan 5, 2018
@bhavincb
Copy link

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?

@T0T4R4
Copy link

T0T4R4 commented Mar 22, 2018

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.

@zbranzov
Copy link
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.

@bhavincb
Copy link

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
Labels
Projects
None yet
Development

No branches or pull requests

5 participants