Jaziel Tan
Jaziel Tan

Reputation: 35

SASS Web essentials compiler global variable on visual studio

I have visual studio 2013 express for web with web essentials 2013. and I'm working with SASS (bootstrap 3)

I've noticed that whenever I am editing a partial file like _table.scss I get a list of errors of undeclared variables.

This becomes a problem when i need to compile the files.

I have no issues when I'm working with sublime using a ruby compiler.

The Errors disappears when I place a @import "variables"; a partial file.

I'm new to VS2013 and I'm not sure if I'm missing something.

Upvotes: 2

Views: 1507

Answers (1)

Colin Bacon
Colin Bacon

Reputation: 15609

Firstly, as long as the parent SCSS file (the one being compiled) is importing the variables file and this is imported before the other partials then this will compile fine.

Example

_table.scss

.bacon {
  color: @my-colour;
}

site.scss

@import "variables" // Contains @my-colour
@import "table";

If the problem you are describing is the squiggly lines when viewing your SASS partial in Visual Studio, you can add a reference to the top of the partial file to get rid of these.

Example

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

Upvotes: 5

Related Questions