ritwickdey / vscode-live-sass-compiler

Compile Sass or Scss file to CSS at realtime with live browser reload feature.
https://ritwickdey.github.io/vscode-live-sass-compiler/
MIT License
658 stars 169 forks source link

partial import of _variables.scss #34

Open robertmazzo opened 6 years ago

robertmazzo commented 6 years ago

Hello, I have two different version of your live-sass-compiler - 1.1.0 on my laptop, and 1.2.0 on my desktop, both Win 10 machines. I created an _variables.scss file, and just import it into styles.scss (same folder level):

sass\styles.scss - @import "variables.scss"

On my desktop (1,2,), the error is:


Watching...

Compilation Error Error: File "c:\dev\TIP\trunk\Development\WebApp\ng2\unicorn\src\sass\variables.scss" not found on line 1 of sass/c:\dev\TIP\trunk\Development\WebApp\ng2\unicorn\src\sass\styles.scss

@import "variables.scss"

If I change it now using the underscore, it does generate a css file.

sass\styles.scss - @import "_variables.scss"

Watching...

Change Detected... styles.scss

Generated : c:\dev\TIP\trunk\Development\WebApp\ng2\unicorn\dist\css\styles.min.css c:\dev\TIP\trunk\Development\WebApp\ng2\unicorn\dist\css\styles.min.css.map

Workspace settings.json is the default one from your extesion.

thank you, Bob

ritwickdey commented 6 years ago

Is this working in v1.1.0?

ritwickdey commented 6 years ago

Oh! I got the issue. Just remove the extension @import "variables" ....... (no extension)... It should work

ritwickdey commented 6 years ago

Honestly, I don't know Sass/Scss much!

I think it's not standardize way that you're specifying extension name of partial sass.

Either you've specify "_variables.scss" (full path - Explicit) or "variables" (full path - Implicit).

Let me know if I'm wrong!

robertmazzo commented 6 years ago

You're right. I should not be specifying the file extension for my partials. Thank you. This works just fine in my main.scss file:

   @import "variables";
   @import "base";
arshali2774 commented 4 years ago

i have the same issue, when i try to import a partial file like, @import ""; the moment i click between the inverted commas a message appears showing error in extension and the error is Error: File "c:\Users\arsha\OneDrive\Desktop\portfolio\style\global" not found on line 1 of sass/c:\Users\arsha\OneDrive\Desktop\portfolio\style\style.scss

@import "global"; --------^

Error: File "c:\Users\arsha\OneDrive\Desktop\portfolio\style\global" not found on line 1 of sass/c:\Users\arsha\OneDrive\Desktop\portfolio\style\style.scss

@import "global"; --------^

arshali2774 commented 4 years ago

Screenshot (168) this is my vs code screeen