2023-03-02 07:16:36 +08:00
|
|
|
import type { AliasToken, GenerateStyle } from '../../theme/internal'
|
|
|
|
import type { TokenWithCommonCls } from '../../theme/util/genComponentStyleHook'
|
|
|
|
|
2023-04-18 15:49:28 +08:00
|
|
|
const genCollapseMotion: GenerateStyle<TokenWithCommonCls<AliasToken>> = (
|
|
|
|
token
|
|
|
|
) => ({
|
2023-03-02 07:16:36 +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
|