如何将焦点轮廓添加到材质按钮

时间:2021-05-03 06:18:28

标签: css angular button sass angular-material

我正在尝试添加

.mat-stroked-button, .mat-flat-button {
    &:focus, &:active:focus {
        outline-width: 3px !important;
        outline-color: red !important;
    }
}

但它不起作用。 我也想知道是否可以删除使按钮变暗的默认焦点样式。我很感激任何帮助。 谢谢

1 个答案:

答案 0 :(得分:0)

.mat-stroked-button, .mat-flat-button {
    outline-style: none;
    &:focus, &:active:focus {
        outline-style: solid;
        outline-width: 3px;
        outline-color: red;
    }
}