无法创建可在所有Sass文件中复用的主题文件问题求助
目标
我希望在theme.sass中通过@use '@angular/material' as mat引入Angular Material的Sass模块,同时能在项目里其他任意Sass文件中引入并使用theme.sass。
问题
当前theme.sass的代码如下:
@use '@angular/material' as mat @include mat.core() $localPalette: mat.$red-palette
单独编译这个文件时没有任何报错,但当其他Sass文件(比如colors.sass)尝试通过@use "../theme" as style、@import "../theme"引入它,或者自身也使用@use "@angular/material" as mat时,就会抛出以下错误:
Error: Can't find stylesheet to import.
╷
1 │ @use '@angular/material' as mat
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
..\theme.sass 1:1 @use
colors.sass 1:1 root stylesheet
当前环境配置
- 编辑器:最新版WebStorm
- Sass编译命令参数:
--load-path ../node_modules $FileName$:$FileNameWithoutExtension$.css
内容的提问来源于stack exchange,提问作者xRay
相关产品推荐
相关产品推荐

