我的应用程序中的SCSS配置在Angular材料方面存在麻烦 -



好,

尝试启动我的Angular App时,我会出现以下错误/警告。

    ERROR in ./src/styles/styles.scss (./node_modules/@angular-devkit/build- 
    angular/src/angular-cli-files/plugins/raw-css- 
    loader.js!./node_modules/postcss-loader/src?? 
    embedded!./node_modules/sass-loader/lib/loader.js??ref--13- 
    3!./src/styles/styles.scss) 
    Module build failed (from ./node_modules/sass-loader/lib/loader.js): 
    undefined 
    ^ 
    Undefined operation "rem(1.4) * 13". 
    ╷ 
    1788 │ $button-font-size-dense: $body-font-size-base * 13/14 !default; 
    │ ^^^^^^^^^^^^^^^^^^^^^^^^^ 
    ╵ 
    node_modulesangular-materialangular-material.scss 1788:26 @import 
    srcstyles_material.scss 8:9 @import 
    stdin 1:9 root stylesheet 
    in
    E:REPRIMXSellcodesProj_MEANProtikAPPXBaseSideAPPBaseSideAPPnode_modulesangular-materialangular-material.scss (line 1788, column 26) 

现在,这是我的_material.scs。

@font-face { 
font-family: 'Fontil Sans'; 
src: url('../assets/fonts/FontinSans/Fontin_Sans_R.otf') format('opentype'); 
} 
@import '~@angular/material/prebuilt-themes/indigo-pink.css'; 
@import '~@angular/material/theming'; 

$custom-typography: mat-typography-config( 
$font-family: 'Fontil Sans, monospace', 
$headline: mat-typography-level(32px, 48px, 700), 
$body-1: mat-typography-level(16px, 24px, 500) 
); 
@include angular-material-typography($custom-typography);

我通过NPM在项目中添加了角色和角度/主题。所以呢?为什么这是失败的?我猜想可能需要用角材料代替角度/材料?是还是其他问题?

您需要查看我的angular.json才能获得更多想法吗?如果是这样,请告诉我,我将分享。

请给我一些提示,卡住!

看来您导入了不正确的软件包,Angularjs的角材料。

node_modules**angular-material**angular-material.scss 1788:26 @import...

如果是真的,您只需要删除此软件包。

添加然后添加@angular/material@angular/cdk

您可以在Angular组件的官方文档中检查更多详细信息(Angular材料的新名称(。

最新更新