0

I have a file _content-sidebar.scss at this location:

C:\Users\user\Downloads\livemath\sass\layout\_content-sidebar.scss

Which contains the following code:

@import "//variables-site/structure";

.content-area {
    float: left;
    margin: 0 (-$size__site-sidebar) 0 0;
    width: $size__site-main;
}

And I have another file called _structure.scss at this location:

C:\Users\user\Downloads\livemath\sass\variables-site\_structure.scss

Which contains the following code:

$size__site-main: 960px;
$size__site-sidebar: 25%;

And when I'm trying to compile the scss file using the command line I'm getting this error:

Change detected to: sass/layout/_content-sidebar.scss
      error sass/layout/_content-sidebar.scss (Line 5: Undefined variable: "$size__site-sidebar".)
9Algorithm
  • 1,258
  • 2
  • 16
  • 22
  • @Matt why was this question reopened? The question this was closed as a duplicate of [contains the answer to this question](http://stackoverflow.com/a/16947612/1652962). – cimmanon Apr 07 '16 at 12:28
  • @cimmanon: We received a flag on this question: *This question is closed as a duplicate, but this is incorrect. The question that is linked to for answering this "duplicate", is about external resources, but the question that is asked here explicitly states that both files are at the same location. The user posted both paths in his description.*. Having looked at both posts, I wholly agree with the flagger, and fail to see *why* you think they are duplicates. – Matt Apr 07 '16 at 13:01
  • [Addresses beginning with double slashes are *not* local to the file system](http://stackoverflow.com/questions/4071117/uri-starting-with-two-slashes-how-do-they-behave). Just because you and the OP don't understand this doesn't make it not a duplicate. See: http://www.sassmeister.com/gist/5b40cd1e30c94e15a0026f8b9a5bc01b – cimmanon Apr 07 '16 at 13:10
  • @cimmanon I understand this already. It was my fault. But these questions are absolutely different. I've nedded to see a different issue. Could you understand why? – 9Algorithm Apr 07 '16 at 14:21
  • Again, just because you didn't understand what was causing the issue does not mean the questions are not duplicates. You should have asked for clarification if you didn't understand why it was a duplicate, rather than flying over the head of an expert in the subject and going to a moderator. You ignored my previous (now deleted comment) before I closed this question. – cimmanon Apr 07 '16 at 14:57
  • @cimmanon I'm sorry if I'm wrong. But I didn't go to a moderator. – 9Algorithm Apr 07 '16 at 15:06

1 Answers1

1

You used double slashes for resources, that are not located at external locations:

C:\Users\user\Downloads\livemath\sass\layout\_content-sidebar.scss

and

C:\Users\user\Downloads\livemath\sass\variables-site\_structure.scss

You could write it with a dot @import "./variables-site/structure"; if it's in the root or maybe @import "../variables-site/structure"; to get into the other folder!

I tested the double slashes for internal resources in my project and it spitted out the same error (that the first occurrence of a variable is undefined)!

Normally it would state that the file couldn't be imported, but unfortunately this is not the case when using double slashes...

sepiott
  • 600
  • 4
  • 18
  • If the question is a duplicate, which apparently you're now willing to admit after reading comments and the content from the other question, you should be flagging or voting to close it as such, not posting an answer. – cimmanon Apr 13 '16 at 10:03