Skip to content
Discussion options

You must be logged in to vote

Nothing is wrong with your setup. With @use, Sass no longer puts everything in one global scope like @import did: 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 is bootstrap, so you reach the variable and the mixin through it:

@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: / no longer divides in Dart Sass (use math.div(), or * .5), and if you would rather not type the namespace everywhere you can write @use "bootstrap/scss/bootstr…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@julien-deramond
Comment options

Comment options

You must be logged in to vote
1 reply
@miken32
Comment options

Comment options

You must be logged in to vote
3 replies
@julien-deramond
Comment options

@miken32
Comment options

@julien-deramond
Comment options

Answer selected by miken32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants