![](/img/trans.png)
[英]How To Style Mat-Ink-Bar with Different Color for Each Mat-Tab In Angular Material?
[英]How do you remove the Angular Material mat-ink-bar?
我無法隱藏墨欄。 我嘗試了許多不同的事情,但沒有成功。 這是我目前擁有的 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;
}
我在更改活動選項卡樣式時遇到了同樣的問題,我使用以下樣式對其進行了修復。
: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;
}
我也面臨同樣的問題,我已經解決了這個問題
/* 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;
}
自 Angular (Material) 15 mat-ink-bar 已更名。 我能夠使用全局 scss 中的以下代碼片段將其刪除:
.mdc-tab-indicator__content {
display: none;
}
/* 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;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.