ant-design/components/style/motion/collapse.tsx
MadCcc 357750e081
refactor: collapse motion (#36597)
* chore: v5.0.0-experimental.5

* refactor: collapse motion
2022-07-19 22:53:38 +08:00

25 lines
844 B
TypeScript

import type { AliasToken, GenerateStyle } from '../../theme';
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
const genCollapseMotion: GenerateStyle<TokenWithCommonCls<AliasToken>> = token => ({
[token.componentCls]: {
// For common/openAnimation
[`${token.antCls}-motion-collapse-legacy`]: {
overflow: 'hidden',
'&-active': {
transition: `height ${token.motionDurationMid} ${token.motionEaseInOut},
opacity ${token.motionDurationMid} ${token.motionEaseInOut} !important`,
},
},
[`${token.antCls}-motion-collapse`]: {
overflow: 'hidden',
transition: `height ${token.motionDurationMid} ${token.motionEaseInOut},
opacity ${token.motionDurationMid} ${token.motionEaseInOut} !important`,
},
},
});
export default genCollapseMotion;