Here are some style snippets:
tokens.scss
.text-center {
text-align:center;
}
.bold {
font-weight: bold;
}
@mixin text-style-1 {
font-size: 1.2rem;
font-weight: bold;
}
component/card.scss
@use "../token.scss" as tokens;
.card {
@include tokens.text-style-1;
border: 1px solid #333333;
}
index.scss
// Importing components
@use component/card.scss
// Importing tokens
@use tokens.scss
While compiling index.scss, I want the styles from tokens.scss to be included after my component styles. However, due to using mixins from tokens.scss in my components, it always gets imported first and not in the specified order in index.scss.
Is there a way to only include the mixins from tokens.scss without importing all the styles before my components? Or is there a method to define import order when using @use?
The only solution I've found so far is replacing @use with @import in index.scss, but this creates duplicate styling which is not ideal.