angular-material-css-vars
angular-material-css-vars copied to clipboard
SCSS @use rule support
The documentation encourages to use the @import
rule to load the necessary SCSS files from the library. A while ago, the Sass team introduced a new module system with the new @use
rule.
I am able to use this new module system to initialize the library with the following code:
@use "~angular-material-css-vars/main";
@include main.init-material-css-vars();
So far, so good. But see what happens if I need the $mat-css-theme
variable:
@use "~angular-material-css-vars/main";
@include main.init-material-css-vars() {
@include init($mat-css-theme);
}
I'm now getting a SassError: Undefined variable
during build. It seems like the $mat-css-theme
variable like it is declared, is not available in the new module system.
As at some time @import
will be deprecated, this library should be updated to work well with the @use
rule.
Hey there! Thanks for opening this up. You're most likely right, but for now I am pretty ok with the situation and the lib as it is, so I won't work on something like that myself until necessary. Pull requests supporting this would be welcome however.
@johannesjo issue can be closed