Skip to content

Commit

Permalink
fix(Table): style value should support CSS var (#50355)
Browse files Browse the repository at this point in the history
* fix(Table): zIndex value should support CSS var

* fix: fix
  • Loading branch information
li-jia-nan authored Aug 11, 2024
1 parent 0c97a6f commit dab9ab6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/table/style/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@ export const prepareComponentToken: GetDefaultToken<'Table'> = (token) => {
};
};

const zIndexTableFixed = 2;

// ============================== Export ==============================
export default genStyleHooks(
'Table',
Expand Down Expand Up @@ -522,8 +524,6 @@ export default genStyleHooks(
calc,
} = token;

const zIndexTableFixed: number = 2;

const tableToken = mergeToken<TableToken>(token, {
tableFontSize: cellFontSize,
tableBg: colorBgContainer,
Expand Down Expand Up @@ -551,7 +551,7 @@ export default genStyleHooks(
tableSelectedRowBg: rowSelectedBg,
tableSelectedRowHoverBg: rowSelectedHoverBg,
zIndexTableFixed,
zIndexTableSticky: zIndexTableFixed + 1,
zIndexTableSticky: calc(zIndexTableFixed).add(1).equal(),
tableFontSizeMiddle: cellFontSizeMD,
tableFontSizeSmall: cellFontSizeSM,
tableSelectionColumnWidth: selectionColumnWidth,
Expand Down
2 changes: 1 addition & 1 deletion components/table/style/selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const genSelectionStyle: GenerateStyle<TableToken, CSSObject> = (token) => {
},

[`table tr th${componentCls}-selection-column${componentCls}-cell-fix-left`]: {
zIndex: token.zIndexTableFixed + 1,
zIndex: calc(token.zIndexTableFixed).add(1).equal(),
},

[`table tr th${componentCls}-selection-column::after`]: {
Expand Down

0 comments on commit dab9ab6

Please sign in to comment.