Reputation: 906
In my React app, I have a file called _variables.scss
with the following code. It contains variables that I want to use in all my .scss files:
$navy: #264653;
$green: #2A9D8F;
$yellow: #E9C46A;
$orange: #F4A261;
$red: #E76F51;
$title-font: "Arial Rounded MT Bold", sans-serif;
$text-font: "Raleway", sans-serif;
I want to use the variables in another .scss file. This is my code in the other file:
@use './design/variables' as v;
* {
font-family: v.$text-font;
}
However, instead of recognizing the variable, my React app returns the following error:
I have already checked that the path of the file is the correct one.
How can I fix this error?
Upvotes: 1
Views: 763
Reputation: 2105
I am assuming you are using Node-Sass as most are. @use
is only supported by Dart-Sass yet and probably forever. The announcement that @import
would be depricated was made 5 years ago.
Upvotes: 1