1

I'm moving up to new SASS module system from @import to @use but I have some issues while I do that with bootstrap v5 :

enter image description here

from :

@import "~bootstrap/scss/bootstrap";
@import "~bootstrap/scss/functions";
@import "~bootstrap/scss/variables";
@import "~bootstrap/scss/mixins";

to :

@use "~bootstrap/scss/bootstrap";
@use "~bootstrap/scss/functions";
@use "~bootstrap/scss/variables";
@use "~bootstrap/scss/mixins";
jhon-jhones
  • 455
  • 1
  • 13
  • 27

1 Answers1

1

The new sass ruel @use works complete different from the old rule @import. With @use you have to import i.e. your variables to every file where you need them. So to replace the new rule against the new one does not work. I fyou want to work with @use you need a complete new project structure.

For more information have a look to this question:
When importing a file with @use then: Error Undefined Mixin

As Bootstrap is a close module wich is working internal with @import there is a special way to get the whole framework at once. Here is an example, - but I didn't test this special solution right now:
How to import and customize bootstrap with @use in SASS/SCSS

Brebber
  • 2,986
  • 2
  • 9
  • 19