Angular NG-Select Theme SCSS imports not working and showing the @Import as Unknown Property Name

Viewed 29

I'm having issues using a scss import. I am trying to import both the default styles and material styles from the NG Select library. This was working before but I think broke during the upgrade to angular 14.

.ng-select-material {
  @import "~@ng-select/ng-select/themes/material.theme.css";
}

.ng-select-default {
  @import "~@ng-select/ng-select/themes/default.theme.css";
}

This is really all there is to the code, and depending on which theme was needed for the input it would use one of these classes, but now neither styles are applying and in the browser inspect for either of those classes the import is striked out and says "Unknown Property Name".

Thanks for the help!

1 Answers

If anyone runs into a similar problem, changing the path to "node_modules/@ng-select/ng-select/themes/material.theme" fixed it for me.

.ng-select-material {
  @import "node_modules/@ng-select/ng-select/themes/material.theme";
}

.ng-select-default {
  @import "node_modules/@ng-select/ng-select/themes/default.theme";
}
Related