0

For a while I have been using the @import to create the following SCSS folder structure. to import the 3 partials into _utilities-dir.scss etc... By adding the partials into the _utilities-dir.scss for example.

utilities
    _utilities-dir.scss
    _functions.scss
    _mixins.scss
    _variables.scss

base
    __base-dir.scss
    _reset.scss
    _typography.scss

I then used to use the @import method to create the main.scss file

@import "/utilities/utilities-dir",
@import "/utilities/base-dir",

How can I create the same output using the new @use method?

Will
  • 1,001
  • 1
  • 6
  • 12

1 Answers1

0

With new rule @use you need to @use the needed file to EVERY file where you need to use the vars or methods of that file.

In other words:
It is not enough to @use file utilities-dir to main file. In that case you can use the vars/methods in main file only. You have to @use the files in every partial direct where you want/need the vars/methods ...

As we had that several times: if you like you may have a look to a longer explanation with explaining code scheme example here: https://stackoverflow.com/a/66300336/9268485.

Brebber
  • 2,986
  • 2
  • 9
  • 19