Building v6 #43234
|
I assume I'm doing something wrong here, I'm testing migration from v5 and Sass keeps telling me variables and mixins don't exist. e.g. @use "bootstrap/scss/bootstrap";
.myclass {
padding: $spacer / 2;
}
@include media-breakpoint-down(sm) {
...
}Result: It's running via Laravel Vite, I haven't touched the processor config yet. Any thoughts? |
Replies: 3 comments 5 replies
|
I know for the first one I can use the |
|
I've only just started working with v6 myself, but my guess is: or And as I understand it: |
|
Nothing is wrong with your setup. With @use "sass:math";
@use "bootstrap/scss/bootstrap";
.myclass {
padding: math.div(bootstrap.$spacer, 2);
}
@include bootstrap.media-breakpoint-down(sm) {
// ...
}Two other v5 habits to update on the way: Here it is running with |
Nothing is wrong with your setup. With
@use, Sass no longer puts everything in one global scope like@importdid: the members of a module live behind a namespace, which defaults to the last part of the URL. For@use "bootstrap/scss/bootstrap"that namespace isbootstrap, so you reach the variable and the mixin through it:Two other v5 habits to update on the way:
/no longer divides in Dart Sass (usemath.div(), or* .5), and if you would rather not type the namespace everywhere you can write@use "bootstrap/scss/bootstr…