ant-design/components/table/style/radius.tsx
二货机器人 8f5b9b5f84
refactor: Full token table (#35888)
* chore: more

* chore: more

* refactor: full token
2022-06-02 18:47:14 +08:00

53 lines
1.3 KiB
TypeScript

import type { CSSObject } from '@ant-design/cssinjs';
import type { GenerateStyle } from '../../_util/theme';
import type { TableToken } from './index';
const genRadiusStyle: GenerateStyle<TableToken, CSSObject> = token => {
const { componentCls, tableRadius } = token;
return {
[`${componentCls}-wrapper`]: {
[componentCls]: {
'&-title': {
borderRadius: `${tableRadius}px ${tableRadius}px 0 0`,
},
'&-title + &-container': {
borderStartStartRadius: 0,
borderStartEndRadius: 0,
'table > thead > tr:first-child': {
'th:first-child': {
borderRadius: 0,
},
'th:last-child': {
borderRadius: 0,
},
},
},
'&-container': {
borderStartStartRadius: tableRadius,
borderStartEndRadius: tableRadius,
'table > thead > tr:first-child': {
'th:first-child': {
borderStartStartRadius: tableRadius,
},
'th:last-child': {
borderStartEndRadius: tableRadius,
},
},
},
'&-footer': {
borderRadius: `0 0 ${tableRadius}px ${tableRadius}px`,
},
},
},
};
};
export default genRadiusStyle;