I'm trying to import a sass partial (_variables.scss
) to use in my main stylesheet (global.scss
), but I keep getting the Error: Undefined variable.
on sass compiling.
Directory structure:
app
└─public
└─styles
│ global.css (output for sass compiling is here).
└─sass
└─_variables.scss
└─global.scss
_variables.scss
$font-text: 'lato', sans-serif;
global.scss
@use '_variables';
body {
font-family: $font-text;
}
Looking at the Sass documentation, I understand to use @use
instead of @import
(which works) because they are phasing it out.
What am I doing wrong here? Thanks.