我正在尝试将主题应用于角度应用程序。\n我认为我创建的 src/theme.scss 文件本身可以正常工作;但当我导入“~@angular/material/theming”时,出现错误:
\nModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):\nSassError: Can't find stylesheet to import.\n \xe2\x95\xb7\n5 \xe2\x94\x82 @forward '../cdk/a11y/index.import';\n \xe2\x94\x82 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n \xe2\x95\xb5\n node_modules\\@angular\\material\\_theming.scss 5:1 @use\n src\\theme.scss 2:1 root stylesheet\n \nRun Code Online (Sandbox Code Playgroud)\n我调查了几个帖子,但无法解决我的问题。
\n这是我的 src/theme.scss :
\n@use "~@angular/material/theming" as mat;\n\n\n@include mat-core();\n\n$app-primary: mat.define-palette(mat.$indigo-palette, 500);\n$app-accent: mat.define-palette(mat.$orange-platte, 600);\n\nRun Code Online (Sandbox Code Playgroud)\n这是/material/_theming.scss:
\n// Forwards all public API mixins so they can be imported from a single entry point.\n// Note that we have to forward the `.import` files for backwards-compatibility with\n// projects that don't …Run Code Online (Sandbox Code Playgroud)