Skip to content

Commit

Permalink
feat: recover v4 table style (ant-design#40469)
Browse files Browse the repository at this point in the history
* Revert "fix: when table filter, the border will be black (ant-design#39938)"

This reverts commit 401ef66.

* feat: revert v5 table style
  • Loading branch information
MadCcc authored and RedJue committed Apr 25, 2023
1 parent 5a5b6c9 commit 50ba8e2
Showing 1 changed file with 1 addition and 68 deletions.
69 changes: 1 addition & 68 deletions components/table/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ const genTableStyle: GenerateStyle<TableToken, CSSObject> = (token) => {
tableFooterTextColor,
tableFooterBg,
paddingContentVerticalLG,
wireframe,
} = token;
const tableBorder = `${lineWidth}px ${lineType} ${tableBorderColor}`;
return {
Expand Down Expand Up @@ -170,44 +169,11 @@ const genTableStyle: GenerateStyle<TableToken, CSSObject> = (token) => {
},

// ============================ Body ============================
// Borderless Table has unique hover style, which would be implemented with `borderTop`.
[`${componentCls}:not(${componentCls}-bordered)`]: {
[`${componentCls}-tbody`]: {
'> tr': {
'> td': {
borderTop: tableBorder,
borderBottom: 'transparent',
},

'&:last-child > td': {
borderBottom: tableBorder,
},

[`&:first-child > td,
&${componentCls}-measure-row + tr > td`]: {
borderTop: 'none',
borderTopColor: 'transparent',
},
},
},
},

// Bordered Table remains simple `borderBottom`.
// Ref issue: https://github.com/ant-design/ant-design/issues/38724
[`${componentCls}${componentCls}-bordered`]: {
[`${componentCls}-tbody`]: {
'> tr': {
'> td': {
borderBottom: tableBorder,
},
},
},
},

[`${componentCls}-tbody`]: {
'> tr': {
'> td': {
transition: `background ${motionDurationMid}, border-color ${motionDurationMid}`,
borderBottom: tableBorder,

// ========================= Nest Table ===========================
[`
Expand Down Expand Up @@ -248,39 +214,6 @@ const genTableStyle: GenerateStyle<TableToken, CSSObject> = (token) => {
},
},

[`${componentCls}:not(${componentCls}-bordered) ${componentCls}-tbody > tr`]: wireframe
? undefined
: {
[`&${componentCls}-row:hover, &${componentCls}-row${componentCls}-row-selected`]: {
[`+ tr${componentCls}-row > td`]: {
borderTopColor: 'transparent',
},
},

[`&${componentCls}-row:last-child:hover > td,
&${componentCls}-row${componentCls}-row-selected:last-child > td`]: {
borderBottomColor: 'transparent',
},

[`
&${componentCls}-row:hover > td,
> td${componentCls}-cell-row-hover,
&${componentCls}-row${componentCls}-row-selected > td
`]: {
borderTopColor: 'transparent',

'&:first-child': {
borderStartStartRadius: tableRadius,
borderEndStartRadius: tableRadius,
},

'&:last-child': {
borderStartEndRadius: tableRadius,
borderEndEndRadius: tableRadius,
},
},
},

// ============================ Footer ============================
[`${componentCls}-footer`]: {
padding: `${tablePaddingVertical}px ${tablePaddingHorizontal}px`,
Expand Down

0 comments on commit 50ba8e2

Please sign in to comment.