mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-05 23:46:28 +08:00

* style: add basic styles of table * style: add basic border styles of table * style: add more styles of table * style: add more styles of table * style: add pagination and summary styles * add more styles * style: add cell-ellipsis styles * style: add Radius style * style: add basic styles of table * style: add basic border styles of table * style: add more styles of table * style: add more styles of table * style: add pagination and summary styles * add more styles * style: add cell-ellipsis styles * style: add Radius style * style: add sorter style * style: add sorter style * style: add filter style * style: add filter style * style: add filter style * style: fix filter and sort style * style: fix bordered style * style: fix bordered style * style: fix bordered style * style: add size style * style: fix size style * style: add selection style * style: format code * style: add sticky code * style: add expand code * style: add expand code * style: add expand code * style: add fixed code * add fixed style * style: fix diff place * style: use number as px string * chore: improve function name * chore: use token * style: rtl styles * chore: fix marigin and padding logical properties * fix: rtl styles * fix: table filter dropdown style * chore: remove useStyle * chore: revert classNames * fix: test case * fix shadow in rtl * Apply suggestions from code review * chore: sub filter tree * style: fix tree dropdown padding Co-authored-by: zombiej <smith3816@gmail.com>
53 lines
1.5 KiB
TypeScript
53 lines
1.5 KiB
TypeScript
import type { CSSObject } from '@ant-design/cssinjs';
|
|
import { TinyColor } from '@ctrl/tinycolor';
|
|
import type { GenerateStyle } from '../../_util/theme';
|
|
import type { TableToken } from './index';
|
|
|
|
const genStickyStyle: GenerateStyle<TableToken, CSSObject> = token => {
|
|
const { componentCls } = token;
|
|
const tableBorder = `${token.controlLineWidth}px ${token.controlLineType} ${token.tableBorderColor}`;
|
|
return {
|
|
[`${componentCls}-wrapper`]: {
|
|
[`${componentCls}-sticky`]: {
|
|
'&-holder': {
|
|
position: 'sticky',
|
|
zIndex: token.zIndexTableSticky,
|
|
background: token.colorBgComponent,
|
|
},
|
|
|
|
'&-scroll': {
|
|
position: 'sticky',
|
|
bottom: 0,
|
|
zIndex: token.zIndexTableSticky,
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
background: new TinyColor(token.tableBorderColor).lighten(80).toRgbString(),
|
|
borderTop: tableBorder,
|
|
opacity: 0.6,
|
|
|
|
'&:hover': {
|
|
transformOrigin: 'center bottom',
|
|
},
|
|
|
|
// fake scrollbar style of sticky
|
|
'&-bar': {
|
|
// FIXME
|
|
height: 8,
|
|
// FIXME
|
|
backgroundColor: 'rgba(0, 0, 0, 0.35)',
|
|
borderRadius: 100,
|
|
transition: `all ${token.motionDurationSlow}`,
|
|
|
|
'&:hover, &-active': {
|
|
// FIXME
|
|
backgroundColor: 'rgba(0, 0, 0, 0.8)',
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
export default genStickyStyle;
|