5 Matching Annotations
- Dec 2020
-
-
node-sass may be faster than dart-sass, but as of writing this dart-sass is the only library which implements the @use rule, which is strongly recommended over @import. According to the official sass-lang website:
-
- Nov 2020
-
sass-lang.com sass-lang.com
-
The rule is written @forward "<url>". It loads the module at the given URL just like @use, but it makes the public members of the loaded module available to users of your module as though they were defined directly in your module. Those members aren’t available in your module, though—if you want that, you’ll need to write a @use rule as well.
Just like how you have to also import (@use) a JS module if you want to use it locally, even if you export (@forward) it.
-
-
css-tricks.com css-tricks.com
-
The file is only imported once, no matter how many times you @use it in a project.
Is this @use sort of like import is in JavaScript (vs require?? does that import file again?)? Or maybe it's more like
require
vs.load
in Ruby? -
The new @use is similar to @import. but has some notable differences:
-
In brief, @import is being replaced with more explicit @use and @forward rules. Over the next few years Sass @import will be deprecated, and then removed.
-