Reputation: 187
Does node-sass even support @use ? Since I'm getting this error:
SassError: Invalid CSS after "...t-family: fonts": expected expression (e.g. 1px, bold), was ".$roboto;"
Here's the code of Nav.scss:
.nav {
width: 100%;
font-family: fonts.$roboto;
&__item {
margin-bottom: 10px;
font-size: variables.$a;
&_active {
color: rgb(37, 133, 34);
}
}
&__item:last-child {
margin-bottom: 0px;
}
}
Here's the code of fonts.scss:
$roboto: 'Roboto';
Upvotes: 1
Views: 2510
Reputation: 597
The syntax is incorrect for node-sass.
You have defined the font variable correctly in fonts.scss but you need to import the font file into your Nav.scss file if you haven't already with:
@import "PATH/fonts.scss";
You then just need to reference the variable like so:
font-family: $roboto;
Upvotes: 1