The new @use is similar to @import. but has some notable differences:

  • The file is only imported once, no matter how many times you @use it in a project.
  • Variables, mixins, and functions (what Sass calls "members") that start with an underscore (_) or hyphen (-) are considered private, and not imported.
  • Members from the used file (buttons.scss in this case) are only made available locally, but not passed along to future imports.
  • Similarly, @extends will only apply up the chain; extending selectors in imported files, but not extending files that import this one.
  • All imported members are namespaced by default.

https://css-tricks.com/introducing-sass-modules/

@import will be deprecated in favor of @use and @forward, and support will be dropped by October 2022 at the latest.

July 2022 update:

In light of the fact that LibSass was deprecated before ever adding support for the new module system, the timeline for deprecating and removing @import has been pushed back. We now intend to wait until 80% of users are using Dart Sass (measured by npm downloads) before deprecating @import, and wait at least a year after that and likely more before removing it entirely.

March 2023 update:

As week of Mar 06 to Mar 12, the npm downloads of the sass and node-sass packages are 11,700,729 and 2,831,234 respectively, meaning we have reached 80.5% adoption rate for Dart Sass, which is above the target for making the deprecation @import current.

Answer from abney317 on Stack Overflow
🌐
Medium
medium.com › @philip.mutua › difference-between-use-and-import-in-scss-1cb6f501e649
Difference Between @use and @import in SCSS | by Philip Mutua | Medium
October 20, 2024 - Instead, developers should use @use, which introduces a more efficient and predictable module system. @import allows you to include the contents of one SCSS file into another.
🌐
Sass
sass-lang.com › documentation › at-rules › use
Sass: @use
Since Sass is used in the context of many different programming languages with different package management conventions, pkg: URLs have almost no set meaning. Instead, users are encouraged to implement custom importers (using the JS API or the Embedded Sass protocol) that resolve these URLs using the native package manager’s logic.
Discussions

Is it okay to still use @imports? I am trying to exclusively use the modular system of @use and @forward
Looks like @import is headed for deprecation. https://sass-lang.com/documentation/at-rules/import/ What compiler are you using? More on reddit.com
🌐 r/Sass
6
4
April 9, 2024
What is the difference between CSS @import and SASS/SCSS @import? - Stack Overflow
Find centralized, trusted content ... you use most. Learn more about Collectives ... Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... The original CSS have the @import keyword, which helps us with including an external CSS file. So, what is the difference between this @import and the one from SASS/SC... More on stackoverflow.com
🌐 stackoverflow.com
Allow using @use to import only a module's members
I wonder if it would make sense to somehow allow using @use to import only the imported module's members (variables, mixins, functions) but not the imported module's styles. Here is my use case: Supposing this is my master Sass file... @... More on github.com
🌐 github.com
5
December 6, 2019
Sass '@import' and '@use' rules
Are you using node-sass or dart-sass? As far as I know, the @use directive only works in dart-sass at the moment More on reddit.com
🌐 r/Sass
11
12
September 4, 2020
🌐
Reddit
reddit.com › r/sass › is it okay to still use @imports? i am trying to exclusively use the modular system of @use and @forward
r/Sass on Reddit: Is it okay to still use @imports? I am trying to exclusively use the modular system of @use and @forward
April 9, 2024 -

I am migrating a project from bootsrap v4.6 to v5.3.3 (I am using npm and not a cdn for my bootstrap styles). The old structure (creative tim template) used exclusively u/import . I would like to exclusively use u/use but I found it quite difficult to properly get my boostrap files in from node_modules. Even when I u/use ~/bootstrap/scss/bootstrap.scss I still get errors where the variables file is not recognizing the mixin that was declared in the functions file and things alike.

My questions are the following:

  1. Do people still use u/import in modern scss, specifically with bootstrap

  2. Advice on a good general structure for sass files and u/use after migrating from bootstrap v4 to v5.3.3. Specifically how your main.scss is structured, how your custom styles are structured.

Thank you

🌐
Sass
sass-lang.com › documentation › at-rules › import
Sass: @import
Users of other implementations must use the @import rule instead. Sass’s module system integrates seamlessly with @import, whether you’re importing a file that contains @use rules or loading a file that contains imports as a module.
🌐
Aslam Doctor
aslamdoctor.com › home › articles › understanding the difference between import, use & forward in sass
Understanding the difference between import, use & forward in SASS - Aslam Doctor
June 25, 2025 - While import is an older feature, use and forward are part of the newer module system, which is the recommended way to manage SCSS files. The @import rule allows you to include content from other SCSS or CSS files directly into your current file.
🌐
DEV Community
dev.to › mr_ali3n › use-forward-in-sass-2bab
use & @forward in SASS
October 31, 2022 - /project |-- /vars |---- _colors.scss ... SCSS using the @import statement. @use pretty much does the same thing, EXCEPT, that it namespaces your variables, thus, preventing the name collisions....
Find elsewhere
🌐
Liquid Light
liquidlight.co.uk › home
@use and @import rules in SCSS - Liquid Light
July 5, 2023 - This is a problem especially with ... is no longer recommended by Sass. Same as @import, @use rule enables us to break our stylesheet into more practical, smaller sections and load them inside other stylesheets....
🌐
YouTube
youtube.com › coder coder
Sass @import is being replaced with @use and @forward - YouTube
🔥 My course: Responsive Design for Beginners! https://coder-coder.com/responsive/💻 Become a full-stack web dev with Zero to Mastery: https://academy.zeroto...
Published   August 23, 2021
Views   38K
🌐
Medium
stefaniefluin.medium.com › the-new-sass-module-system-out-with-import-in-with-use-e1bd8ba032d0
The New SASS Module System: Out with @import, In with @use | by Stefanie Fluin | Medium
August 4, 2020 - What makes the @use import different is that the module (file imported using @use) is only imported once, no matter how many times you reference it in your project. Tip: You’ll see references to what Sass calls “members” — these include ...
🌐
Andrew M McCall
andrew-mccall.com › blog › 2022 › 06 › scss-use-vs-import
SCSS Use VS Import: How To Use @Use in SCSS | Andrew M McCall
June 7, 2022 - Sass wants us to use @use which ... to put this than cite the official SASS documentation: ... @import makes all variables, mixins, and functions globally accessible....
🌐
YouTube
m.youtube.com › watch
Stop using @import with Sass | @use and @forward explained
Share your videos with friends, family, and the world
Published   February 23, 2021
🌐
Medium
mr-alien.medium.com › use-forward-in-sass-70b9cd44218b
@use & @forward in SASS. I have been working with CSS over the… | by Vaibhav Mehta | Medium
November 17, 2022 - /project |-- /vars |---- _colors.scss ... SCSS using the @import statement. @use pretty much does the same thing, EXCEPT, that it namespaces your variables, thus, preventing the name collisions....
🌐
Vincent-barrault
vincent-barrault.fr › articles › sass-remplacer-import-par-use
Remplacer @import par @use dans Sass - Vincent Barrault
La méthode @use de Sass offre plus d'avantages que @import, qui va peu à peu disparaître.
🌐
GitHub
github.com › sass › sass › issues › 2791
Allow using @use to import only a module's members · Issue #2791 · sass/sass
December 6, 2019 - I think it's useful to draw a comparison with JS modules here. Conceptually, importing a Sass file using @use seems to be similar to importing a JS module that has a side effect, in this case the side effect being that the styles are outputted.
Author   galvarez421
🌐
JavaScript in Plain English
javascript.plainenglish.io › new-sass-module-system-out-with-import-in-with-use-part-2-c73442c0157a
New SASS Module System. Part 2: Out with @ import, in with @… | by Hritik Jaiswal | JavaScript in Plain English
January 14, 2023 - You may have used built-in Sass functions in the past, such as adjust-hue and map.get. Most of these built-in functions will remain available, but not on a global level. This means that you will also need to import these modules using the new @use import rule.
🌐
Reddit
reddit.com › r/sass › sass '@import' and '@use' rules
r/Sass on Reddit: Sass '@import' and '@use' rules
September 4, 2020 -

I've been reading the documentation for Sass. It says that the '@import' rule is going to be phased out, and that the '@use' rule will be the preferred rule. Now when I go to use the '@use' rule it doesn't compile properly. What it should be doing, from my understanding, is importing the code class into style.scss and revealing it's variables.

What's happening is '@use' 'base'; seems to just be copied over. I can see the variables in style.scss, but the code class isn't being imported to the file.

Am I looking at this correctly? What could be going on?

🌐
DEV Community
dev.to › thiagoow › how-use-like-import-sass-new-syntax-omn
How '@use' like '@import' (Sass new syntax) 🤔 - DEV Community
August 4, 2022 - Instead of adding the name of your Sass variables file in front of every single vars in your file, you just need to add 👉🏽 'as *' in the end of your import: @use "../SassFolder/SassFile" as *; And yeah, just with 3 characters, you can use the new '@use' syntax without any more pain.
🌐
GitHub
github.com › vitejs › vite › discussions › 17432
Is there a point to using SASS @use over @import? · vitejs/vite · Discussion #17432
June 9, 2024 - This makes it seem as though the benefits of @use is already provided (or nullified) by Vite. Am I missing something? Beta Was this translation helpful? Give feedback. ... There was an error while loading. Please reload this page. Something went wrong. There was an error while loading. Please reload this page. ... import is deprecated in sass and it can be removed anytime in the next versions https://sass-lang.com/documentation/at-rules/import/
Author   vitejs