我有一个mat-button-toggle并且想将 border-radius
改为 20px
,但它仍然是 4px
。
我做错了什么?
<mat-button-toggle-group class="ruleActionOnOffButton" name="fontStyle" aria-label="Font Style" *ngIf="modules.type === action.type && modules.id === action.id" value="{{action.action}}">
<mat-button-toggle value="1" (change)="selectionChanged($event,i)">An</mat-button-toggle>
<mat-button-toggle value="2" (change)="selectionChanged($event,i)">Aus</mat-button-toggle>
<mat-button-toggle value="3" (change)="selectionChanged($event,i)">Toggle</mat-button-toggle>
</mat-button-toggle-group>
CSS(层叠样式表)
/deep/ .mat-button-toggle-group-appearance-standard, .mat-button-toggle-standalone.mat-button-toggle-appearance-standard{
border-radius: 20px !important;
}
.ruleActionOnOffButton .mat-button-toggle-appearance-standard .mat-button-toggle-label-content{
border-radius: 20px !important;
}
:host
而不是直接使用.ruleActionOnOffButton
,后者也可以工作? - Tomek:host
(也许在以前(Angular版本)这是最好的解决方案)。 - לבני מלכה