更改mat-paginator的[pageSizeOption]字体大小和字体系列

时间:2019-08-14 15:13:00

标签: html css angular angular-material paginator

我的应用程序中有一个mat-paginator,但是显示时[pageSizeOptions]的字体大小似乎无法更改。

<mat-paginator [pageSizeOptions]="[10, 20, 30]"></mat-paginator>

我的意思是,与旁边写的“每页项”相比,“ 10”是如此之小。

CSS甚至无法使用:

.mat-paginator {
    font-family: 'Raleway'!important;
    font-size: large!important;
}

我已经使用theme.scss搜索解决方案:

$custom-typography: mat-typography-config(
  $font-family: '"Raleway", "sans-serif"',
  $body-2:        mat-typography-level(16px, 24px, 600)
);

@include mat-core($custom-typography);

但是没有成功。你们有什么想法要实现吗?

1 个答案:

答案 0 :(得分:1)

也许您可以在样式文件上使用:: ng-deep:

::ng-deep .mat-select-value {
  font-size: 20px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

::ng-deep .mat-option-text {
  font-size: 20px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}