2022-11-23 20:22:38 +08:00
|
|
|
import type { AliasToken, GenerateStyle } from '../../theme/internal';
|
2022-07-19 22:53:38 +08:00
|
|
|
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook';
|
|
|
|
|
2022-11-19 13:47:33 +08:00
|
|
|
const genCollapseMotion: GenerateStyle<TokenWithCommonCls<AliasToken>> = (token) => ({
|
2022-07-19 22:53:38 +08:00
|
|
|
[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;
|