【问题标题】:How do you remove the Angular Material mat-ink-bar?如何删除 Angular Material mat-ink-bar?
【发布时间】:2020-02-14 15:10:59
【问题描述】:

我无法隐藏墨条。我尝试了许多不同的事情,但没有成功。这是我目前拥有的 CSS,它确实改变了墨条的颜色。我希望禁用并完全隐藏它以消除边框阴影。

/* active tab ink bar */
::ng-deep .mat-ink-bar {
  background-color: var(--primary-color,$orange) !important;
  display: none !important;
  visibility: hidden !important;
  transition: none !important;
  height: 0px !important;
  width: 0px !important;
}

【问题讨论】:

    标签: css angular angular-material


    【解决方案1】:

    我在更改活动标签样式时遇到了同样的问题,我使用以下样式修复了它。

    :host ::ng-deep .mat-tab-label {
        height: 3rem !important;
        min-width: 8rem !important;
    }
    
    /* Styles for the active tab label */
    :host ::ng-deep .mat-tab-label.mat-tab-label-active {
        border: 1px solid #2F80ED;
        box-sizing: border-box;
        border-radius: 0.8rem;
    }
    
    /* Styles for the ink bar */
    :host ::ng-deep .mat-ink-bar {
        display: none !important;
    }
    

    【讨论】:

      【解决方案2】:

      你确定不是 ma​​t-tab-nav-bar :

      ::ng-deep .mat-tab-header, .mat-tab-nav-bar {
          border-bottom: 0;
      }
      

      您也可以查看this。

      【讨论】:

      • 你是对的,在我的 CSS 中添加上面的代码是有效的。谢谢!
      【解决方案3】:

      我也遇到了同样的问题,我是这样解决的

      /* header */
      ::ng-deep.mat-tab-group .mat-tab-header, .mat-tab-nav-bar .mat-tab-header{
        border-bottom: none;
      }
      
      /* ink bar style */
      ::ng-deep.mat-tab-group .mat-ink-bar, .mat-tab-nav-bar .mat-ink-bar{
       display: none !important;
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-08-04
        • 1970-01-01
        • 2019-02-25
        • 1970-01-01
        • 2019-05-15
        • 2020-12-04
        • 2018-10-03
        • 2018-10-17
        相关资源
        最近更新 更多