SteinTech
SteinTech

Reputation: 4068

issues with variables when importing SASS file from external site

I have a scss file starting with:

@import "styles";
@import url("http://lctools.lundbeckconsulting.no/SASS/STATIC/lct.public.scss");

Contains a media rule:

@media (max-width: $media-small-width) { //code }

But when compiling the file in Visual Studio I get an error saying that $media-small-width is an Undeclared Variable, even though it exists in lct.public.scss that's imported from the external site.

Using variables from styles.scss (local file) works as expected

Upvotes: 0

Views: 191

Answers (1)

Joni H.
Joni H.

Reputation: 166

This is happening because the import function will only import external files as a CSS import rule - it will not actually import the SCSS from that external file into the rest of your code.

You will need to declare your variables inside your local files. (This might not be the answer you were hoping for. Sorry!)

Documentation on import from SASS: http://sass-lang.com/documentation/file.SASS_REFERENCE.html#_import__import

Upvotes: 1

Related Questions