• Resolved takecare9

    (@takecare9)


    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".)
Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m afraid I’m not completely familiar with how Sass interprets paths on Windows, but my guess is that @import is looking for a folder named variables-site in the same folder as _content-sidebar.scss. On OS X, you would change it to

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

    so Sass would go up a folder level and then into variables-site and then find the right partial.

    Thread Starter takecare9

    (@takecare9)

    Thank you! You’ve helped me for the second time.
    Sorry for this bunch of stupid questions. I’m just starting.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Why is this variable undefined?’ is closed to new replies.