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

标签 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);

但是没有成功。你们知道如何实现吗?

最佳答案

也许你可以在你的样式文件上使用::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;
}

关于html - 更改 mat-paginator 的 [pageSizeOption] 字体大小和字体系列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57497529/

相关文章:

jQuery 延迟加载 : Div inside Div inside Div

HTML/CSS 平铺边框(左、下、右)

css - Material 界面 : How can I change the border color of the Select component?

angular - 如何以编程方式在Ionic的variables.scss中设置变量?

JavaScript onmouseover 未按预期工作

html - 表格在其他浏览器中显示不佳

javascript - 无法在本地存储中保存 css 类的当前状态

javascript - 在 ASPX Repeater 中制作斑马纹

css - SASS 没有更新我的 Ionic 应用程序样式

javascript - 无法将值绑定(bind)到 setter 中 p-autocomplete 中的 ngModel