2

I want to import external files inside the selector using Dart Sass. When I use @use to realize this, it causes an error.

//error
.selector {
    @use 'external-file';
}

I used to use @import to do this before with node-sass and it was OK.

.selector {
    @import 'external-file';
}

Now I'd like to do the same thing with Dart Sass and want to know how. Thank you.

abms
  • 545
  • 1
  • 3
  • 13

1 Answers1

1

I've been searching the same thing and finally found the solution.
meta.load-css does the trick.

https://sass-lang.com/documentation/modules/meta#load-css

@use "sass:meta";
.selector {
    @include meta.load-css('external-file');
}
Satoshi Onoda
  • 141
  • 1
  • 5