You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.5 KiB
58 lines
1.5 KiB
3 years ago
|
import type { CSSObject } from '@ant-design/cssinjs';
|
||
2 years ago
|
import type { GenerateStyle } from '../../theme/internal';
|
||
3 years ago
|
import type { TableToken } from './index';
|
||
|
|
||
2 years ago
|
const genRadiusStyle: GenerateStyle<TableToken, CSSObject> = (token) => {
|
||
3 years ago
|
const { componentCls, tableRadius } = token;
|
||
3 years ago
|
return {
|
||
|
[`${componentCls}-wrapper`]: {
|
||
|
[componentCls]: {
|
||
2 years ago
|
// https://github.com/ant-design/ant-design/issues/39115#issuecomment-1362314574
|
||
|
[`${componentCls}-title, ${componentCls}-header`]: {
|
||
3 years ago
|
borderRadius: `${tableRadius}px ${tableRadius}px 0 0`,
|
||
3 years ago
|
},
|
||
|
|
||
2 years ago
|
[`${componentCls}-title + ${componentCls}-container`]: {
|
||
3 years ago
|
borderStartStartRadius: 0,
|
||
|
borderStartEndRadius: 0,
|
||
|
|
||
2 years ago
|
table: {
|
||
|
borderRadius: 0,
|
||
3 years ago
|
|
||
2 years ago
|
'> thead > tr:first-child': {
|
||
|
'th:first-child': {
|
||
|
borderRadius: 0,
|
||
|
},
|
||
|
|
||
|
'th:last-child': {
|
||
|
borderRadius: 0,
|
||
|
},
|
||
3 years ago
|
},
|
||
|
},
|
||
|
},
|
||
|
|
||
|
'&-container': {
|
||
3 years ago
|
borderStartStartRadius: tableRadius,
|
||
|
borderStartEndRadius: tableRadius,
|
||
3 years ago
|
|
||
|
'table > thead > tr:first-child': {
|
||
2 years ago
|
'> *:first-child': {
|
||
3 years ago
|
borderStartStartRadius: tableRadius,
|
||
3 years ago
|
},
|
||
|
|
||
2 years ago
|
'> *:last-child': {
|
||
3 years ago
|
borderStartEndRadius: tableRadius,
|
||
3 years ago
|
},
|
||
|
},
|
||
|
},
|
||
|
|
||
|
'&-footer': {
|
||
3 years ago
|
borderRadius: `0 0 ${tableRadius}px ${tableRadius}px`,
|
||
3 years ago
|
},
|
||
|
},
|
||
|
},
|
||
|
};
|
||
|
};
|
||
|
|
||
|
export default genRadiusStyle;
|