2022-05-31 10:10:35 +08:00
|
|
|
import type { CSSObject } from '@ant-design/cssinjs';
|
2022-06-27 14:25:59 +08:00
|
|
|
import type { GenerateStyle } from '../../theme';
|
2022-05-31 10:10:35 +08:00
|
|
|
import type { TableToken } from './index';
|
|
|
|
|
|
|
|
const genRadiusStyle: GenerateStyle<TableToken, CSSObject> = token => {
|
2022-06-02 18:47:14 +08:00
|
|
|
const { componentCls, tableRadius } = token;
|
2022-05-31 10:10:35 +08:00
|
|
|
return {
|
|
|
|
[`${componentCls}-wrapper`]: {
|
|
|
|
[componentCls]: {
|
|
|
|
'&-title': {
|
2022-06-02 18:47:14 +08:00
|
|
|
borderRadius: `${tableRadius}px ${tableRadius}px 0 0`,
|
2022-05-31 10:10:35 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
'&-title + &-container': {
|
|
|
|
borderStartStartRadius: 0,
|
|
|
|
borderStartEndRadius: 0,
|
|
|
|
|
|
|
|
'table > thead > tr:first-child': {
|
|
|
|
'th:first-child': {
|
|
|
|
borderRadius: 0,
|
|
|
|
},
|
|
|
|
|
|
|
|
'th:last-child': {
|
|
|
|
borderRadius: 0,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-container': {
|
2022-06-02 18:47:14 +08:00
|
|
|
borderStartStartRadius: tableRadius,
|
|
|
|
borderStartEndRadius: tableRadius,
|
2022-05-31 10:10:35 +08:00
|
|
|
|
|
|
|
'table > thead > tr:first-child': {
|
|
|
|
'th:first-child': {
|
2022-06-02 18:47:14 +08:00
|
|
|
borderStartStartRadius: tableRadius,
|
2022-05-31 10:10:35 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
'th:last-child': {
|
2022-06-02 18:47:14 +08:00
|
|
|
borderStartEndRadius: tableRadius,
|
2022-05-31 10:10:35 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
'&-footer': {
|
2022-06-02 18:47:14 +08:00
|
|
|
borderRadius: `0 0 ${tableRadius}px ${tableRadius}px`,
|
2022-05-31 10:10:35 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default genRadiusStyle;
|