-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@use pass configuration as a map variable #2035
Comments
I tried making a _bootstrap-loader.scss file _bootstrap-loader.scss @use "sass:meta";
@use "variables";
@include meta.load-css("lib/bootstrap/scss/bootstrap", variables.$bootstrap-overrides); Then in my main.scss @use "bootstrap-loader";
@use "lib/bootstrap/scss/bootstrap"; I ended up with 2 complete copies of bootstrap in my CSS. It seems EDIT: @use "sass:meta";
@use "variables";
@include meta.load-css("../../../WebFramework/wwwroot/lib/bootstrap/scss/bootstrap", variables.$bootstrap-overrides);
@forward "../../../WebFramework/wwwroot/lib/bootstrap/scss/bootstrap"; main.scss @use "bootstrap-loader" as bootstrap; And got scolded by the compiler " |
There's no way to pass a map as a configuration. You do indeed need to specify each variable individually.
Configurable variables work through // _wrapper-framework.scss
@forward 'bootstrap';
// Use bootstrap variables/mixins here. // main.scss
@use 'wrapper-framework' with (
$primary: green
);
When you |
Hello,
I want to load bootstrap scss with some variables overridden. So I got my variables in a _variables.scss
_variables.scss
main.scss
The compiler scolds me, I can't do that "syntax error".... I search and find that meta load-css function...
So I try again...
main.scss
I get scolded by the compiler again: "@use rules must be written before any rules"...
So how am I supposed to pass overrides from a map to a module being loaded ? Is there really no way except spell every variable out one by one again ? The problem is that I want to have this bootstrap loading part in a framework, so that in different projects I can pass different bootstrap variables to override....
I can't figure a solution to this problem... Is there any workaround ? I got very frustrated and angry feeling like I am boxed in blocked from very direction with seemingly arbitrary limitations with no way of escape...
Cross reference from a similar unanswered stackoverflow question:
https://stackoverflow.com/questions/69382592/how-to-use-scss-with-map-variable
The text was updated successfully, but these errors were encountered: