Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scss global variables across files

Tags:

This is in VS 2013 update 3. I declared the variables in _variables.scss:

$fontFamily: "Times New Roman", Times, serif; $shapeColor: #ACAEAA; ... 

Then it is imported at the very beginning of my main.scss as below:

@import '_variables.scss'; @import '_base.scss'; // not able to use any variables declared in _variables.css 

In main.scss, all the global variables work fine. However, none of the global variables works in _base.scss. VS refuses to compile them and they are marked as Undeclared Variable. Is this a VS compiler issue or I am doing something wrong?

like image 447
Quentin Avatar asked Sep 09 '14 16:09

Quentin


1 Answers

If you add the following to _base.scss and your intellisense should behave.

/// <reference path="_variables.scss" /> 

I have written a post on this if you need more info Get intellisense in sass/less files in visual-studio

like image 82
Colin Bacon Avatar answered Sep 17 '22 20:09

Colin Bacon