feat: allow user customize table font size (#24714)

This commit is contained in:
Teng YANG 2020-06-04 08:57:58 +08:00 committed by GitHub
parent f36576f12d
commit 3d62c44325
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -574,6 +574,9 @@
@table-footer-bg: @background-color-light;
@table-footer-color: @heading-color;
@table-header-bg-sm: @table-header-bg;
@table-font-size: @font-size-base;
@table-font-size-md: @table-font-size;
@table-font-size-sm: @table-font-size;
// Sorter
// Legacy: `table-header-sort-active-bg` is used for hover not real active
@table-header-sort-active-bg: darken(@table-header-bg, 3%);

View File

@ -19,6 +19,7 @@
position: relative;
z-index: 0;
clear: both;
font-size: @table-font-size;
background: @table-bg;
border-radius: @border-radius-base;

View File

@ -1,7 +1,9 @@
@import './index';
.table-size(@size, @padding-vertical, @padding-horizontal) {
.table-size(@size, @padding-vertical, @padding-horizontal, @font-size) {
.@{table-prefix-cls}.@{table-prefix-cls}-@{size} {
font-size: @font-size;
.@{table-prefix-cls}-title,
.@{table-prefix-cls}-footer,
.@{table-prefix-cls}-thead > tr > th,
@ -48,12 +50,12 @@
// ================================================================
// = Middle =
// ================================================================
.table-size(~'middle', @table-padding-vertical-md, @table-padding-horizontal-md);
.table-size(~'middle', @table-padding-vertical-md, @table-padding-horizontal-md, @table-font-size-md);
// ================================================================
// = Small =
// ================================================================
.table-size(~'small', @table-padding-vertical-sm, @table-padding-horizontal-sm);
.table-size(~'small', @table-padding-vertical-sm, @table-padding-horizontal-sm, @table-font-size-sm);
.@{table-prefix-cls}-small {
.@{table-prefix-cls}-thead > tr > th {