mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-04 00:49:39 +08:00
a1f77f3694
* feat: Table support cssVar * fix: fix * fix: fix * Update check-cssinjs.tsx Signed-off-by: lijianan <574980606@qq.com> * Update components/table/style/fixed.ts Co-authored-by: MadCcc <madccc@foxmail.com> Signed-off-by: lijianan <574980606@qq.com> * fix: fix * fix: fix * fix: fix * fix: fix * fix: fix * fix: fix * fix: fix * fix: fix * feat: optimize token * chore: update --------- Signed-off-by: lijianan <574980606@qq.com> Co-authored-by: MadCcc <madccc@foxmail.com> Co-authored-by: MadCcc <1075746765@qq.com>
56 lines
1.6 KiB
TypeScript
56 lines
1.6 KiB
TypeScript
import { unit, type CSSObject } from '@ant-design/cssinjs';
|
|
|
|
import type { GenerateStyle } from '../../theme/internal';
|
|
import type { TableToken } from './index';
|
|
|
|
const genRadiusStyle: GenerateStyle<TableToken, CSSObject> = (token) => {
|
|
const { componentCls, tableRadius } = token;
|
|
return {
|
|
[`${componentCls}-wrapper`]: {
|
|
[componentCls]: {
|
|
// https://github.com/ant-design/ant-design/issues/39115#issuecomment-1362314574
|
|
[`${componentCls}-title, ${componentCls}-header`]: {
|
|
borderRadius: `${unit(tableRadius)} ${unit(tableRadius)} 0 0`,
|
|
},
|
|
|
|
[`${componentCls}-title + ${componentCls}-container`]: {
|
|
borderStartStartRadius: 0,
|
|
borderStartEndRadius: 0,
|
|
|
|
// https://github.com/ant-design/ant-design/issues/41975
|
|
[`${componentCls}-header, table`]: {
|
|
borderRadius: 0,
|
|
},
|
|
|
|
'table > thead > tr:first-child': {
|
|
'th:first-child, th:last-child, td:first-child, td:last-child': {
|
|
borderRadius: 0,
|
|
},
|
|
},
|
|
},
|
|
|
|
'&-container': {
|
|
borderStartStartRadius: tableRadius,
|
|
borderStartEndRadius: tableRadius,
|
|
|
|
'table > thead > tr:first-child': {
|
|
'> *:first-child': {
|
|
borderStartStartRadius: tableRadius,
|
|
},
|
|
|
|
'> *:last-child': {
|
|
borderStartEndRadius: tableRadius,
|
|
},
|
|
},
|
|
},
|
|
|
|
'&-footer': {
|
|
borderRadius: `0 0 ${unit(tableRadius)} ${unit(tableRadius)}`,
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
export default genRadiusStyle;
|