0

I have used mat-paginator in my project and wanted to reduce size of pagination arrows without using ng-deep

screenshot of mat-paginator result

Currently I am able to do it with following code:

::ng-deep .mat-paginator-icon {
    width: 3vh;
    margin-top: -0.5vh;
  }

But have to do it without using ng-deep! Any suggestions?

I tried encapsulation: ViewEncapsulation.None and achieved results but that's affecting/disordering other UI features on that web page

Saad Ali
  • 1
  • 1
  • It's very surprising to me that you are using the unit `vh` to change the width of the icon. This means that depending on the height of the viewport, the icon will have different sizes. For example, on a mobile phone in landscape mode, the icon will be barely visible. I would recommend to use `px` unit. – JSON Derulo Jan 11 '23 at 08:13
  • @JSON Derulo thanks Sure, will do it but please give some suggestion on how can I reduce arrow size of mat-paginator without using ng-deep – Saad Ali Jan 11 '23 at 08:19

1 Answers1

0

add some class to your mat-paginator something like

<mat-paginator class="a-c"></mat-paginator>

then in your global style.css use this class to apply styles

.a-c .mat-paginator-icon {
    width: 3vh;
    margin-top: -0.5vh;
  }
jitender
  • 10,238
  • 1
  • 18
  • 44