I have this button
<button mat-icon-button color="black" style="height: 21px; bottom: 8px;" *ngIf="!transaction.HasMatch" (click)="matchPayable($event, transaction)">
<mat-icon style="line-height: 20px;">playlist_add</mat-icon>
</button>
The problem is, that when I click on the button, the focus is not exactly around the icon as in this screenshot.
So the focus needs to be moved downwards, but I don’t know how.
It would be an alternative to remove the focus effect completely. Also I don’t know how to achieve this.
2
Answers
The easiest fix was the following:
Applying customized CSS to the
::ng-deep
pseudo-element will allow you to change the focus position of amat-icon-button.
To move the focus impact lower in your situation, paste the CSS code shown below:The
mat-icon-button
element will receive a custom focus effect from this code that shifts the emphasis 5 pixels to the right. Thebottom
value can be changed to alter the focal effect up or down as necessary.You should be aware that
::ng-deep
is a deprecated pseudo-selector and that a separate method should be used to apply styles to child components.