从 Angular Material 复选框中删除刻度线
Remove tick mark from Angular Material Checkbox
我们正在尝试使用 Angular Material Checkbox in a custom visualization. But we do not want the tick mark to appear, i.e. we want an element with color filled but no tick mark. How do we do that? We looked through the css styling 部分文档,但未找到任何相关内容。
tickmark
不是图标。它实际上是由一个倾斜 45 度的简单矩形构建而成。您只需要:
md-checkbox.md-checked .md-icon:after {
border-width: 0;
}
或者,您可以使用
md-checkbox.md-checked .md-icon:after {
display: none;
}
在最新版本中,刻度线是一个 SVG。您可以简单地使用 :
::ng-deep .mat-checkbox-checkmark {
display: none;
}
我们正在尝试使用 Angular Material Checkbox in a custom visualization. But we do not want the tick mark to appear, i.e. we want an element with color filled but no tick mark. How do we do that? We looked through the css styling 部分文档,但未找到任何相关内容。
tickmark
不是图标。它实际上是由一个倾斜 45 度的简单矩形构建而成。您只需要:
md-checkbox.md-checked .md-icon:after {
border-width: 0;
}
或者,您可以使用
md-checkbox.md-checked .md-icon:after {
display: none;
}
在最新版本中,刻度线是一个 SVG。您可以简单地使用 :
::ng-deep .mat-checkbox-checkmark {
display: none;
}