Related: https://github.com/angular/components/issues/9739
I've tried many solutions, including hiding the checkbox (so I could replace with a new button):
::ng-deep .mat-option:first-child .mat-pseudo-checkbox {
display: none;
}
Or from https://stackoverflow.com/a/51942592:
:host {
::ng-deep.mat-pseudo-checkbox{
display: none !important;
}
}
And various other techniques… but none succeed in removing the checkbox.
The only other thing I can think of are messing with ViewEncapsulation
, or using mixins
; like Angular Material uses to build their website:
@mixin component-viewer-theme($theme) {
// … prelude omitted for brevity
guide-viewer,
app-component-viewer {
color: mat-color($foreground, text);
.mat-tab-label:focus {
color: mat-color($foreground, text);
}
}
}
…but that would require maintaining a theme loading hierarchy like they've done. Is there an easier/better approach?