angular-material-css-vars icon indicating copy to clipboard operation
angular-material-css-vars copied to clipboard

SCSS @use rule support

Open dkimmich-onventis opened this issue 4 years ago • 1 comments

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.

dkimmich-onventis avatar Jan 19 '21 16:01 dkimmich-onventis

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 avatar Jan 19 '21 18:01 johannesjo

@johannesjo issue can be closed

ratatoeskr666 avatar Feb 07 '23 13:02 ratatoeskr666