0

I have two files in client folder: style.scss and staff.scss. In the former, I import the latter:

//...
$spacing-unit: 1em;
//...
@import "./staff.scss"

and in staff.scss I try to use a variable that has been defined in style.scss:

//...
.staff {
    margin-bottom: $spacing-unit;
}

but I'm having a following error:

=> Errors prevented startup:                  

   While building the application:
   /Users/rishatmuhametshin/dev/smth/client/staff.scss:3:14: Scss
   compiler error: Undefined variable: "$spacing-unit".


=> Your application has errors. Waiting for file change.

which makes me think that Meteor ignored the import.

What should I do then?

rishat
  • 8,206
  • 4
  • 44
  • 69
  • The matter of my question is SCSS and variables within styles. If I'm correct with that, it has nothing to do with JS scoping (otherwise, I would already have happily known the solution). – rishat Sep 18 '15 at 10:02
  • No but it would have a lot to do with Meteor's files load order which is why I suggested to read this question since, even if it's on a different topic, it might provide the answer (in that case `style.scss` being loaded _after_ `staff.scss`). – Kyll Sep 18 '15 at 10:04

0 Answers0