Use of @use versus @import in SCSS files

Hello,

I just setup a simple site, following the “Themeless & Gitless Introduction to Hugo” tutorial. I now want to add complications to it one at a time, so I can find out how to break and fix things…

What I tried to do is use the inluded style.scss file to extend the stylesheet. So I added the following to the head of the file:

// Import some stylesheets
@import 'styles/asciidoc';

And this did, as expected, import the styles/_asciidoc.scss file in to the stylesheet.

However the Sass docs mention that import is actually depcrecated, and that one should use @use in stead. So I tried that:

// Import some stylesheets
@use 'styles/asciidoc';

However the end result is that the line @use 'styles/asciidoc'; just gets added to the top of the stylesheet.

What am I doing wrong here?

in short: no, Hugo SASS not suported @use yet.

You may check this github issue:

1 Like

Ok. Wish I had know that in advance… Is this just because it was build against an older version?

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.