首页 > 解决方案 > Angular Material Components 有奇怪的样式

问题描述

我不知道为什么我的材质组件如此怪异,就好像它们在我的应用程序中实现得很糟糕一样。

这是幻灯片切换

材料滑动切换

  <div
    fxFlex
    fxLayoutAlign="end center"
    fxLayout="row"
    fxLayoutGap="10px"
    class="right-header margin-right-x2"
  >
     ...
    <div fxLayout="row" fxLayoutAlign="end center" class="theme-container">
      <mat-slide-toggle (click)="toggleTheme()" [checked]="isDarkTheme">
        <mat-icon class="header-icon">highlight</mat-icon>
      </mat-slide-toggle>
    </div>
  </div>

和工具提示,每次都显示在我的应用程序底部

工具提示

  <div
    fxLayoutAlign="start center"
    fxLayout="column"
    fxLayoutGap="15px"
    matTooltip="This is a tooltip"
    class="contacts-container"
  >
    <a>
    </a>
  </div>

如果您能帮助我解决这个问题,我将不胜感激!谢谢。

标签: angularangular-material

解决方案


好的,感谢@Navitas28,我在重新安装时发现我忘记在我的 styles.scss 中导入 mat-core() 了!我的愚蠢错误..

感谢您的回答,祝您有美好的一天!


推荐阅读