mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-30 20:38:45 +08:00
c3f5e27c1c
* fix: fix the flex gap problem * fix: adapt margin problem in css value mode --------- Co-authored-by: afc163 <afc163@gmail.com>
59 lines
1.5 KiB
TypeScript
59 lines
1.5 KiB
TypeScript
import { Keyframes } from '@ant-design/cssinjs';
|
|
|
|
import type { UploadToken } from '.';
|
|
import { initFadeMotion } from '../../style/motion';
|
|
import type { GenerateStyle } from '../../theme/internal';
|
|
|
|
// =========================== Motion ===========================
|
|
const genMotionStyle: GenerateStyle<UploadToken> = (token) => {
|
|
const { componentCls } = token;
|
|
|
|
const uploadAnimateInlineIn = new Keyframes('uploadAnimateInlineIn', {
|
|
from: {
|
|
width: 0,
|
|
height: 0,
|
|
padding: 0,
|
|
opacity: 0,
|
|
margin: token.calc(token.marginXS).div(-2).equal(),
|
|
},
|
|
});
|
|
|
|
const uploadAnimateInlineOut = new Keyframes('uploadAnimateInlineOut', {
|
|
to: {
|
|
width: 0,
|
|
height: 0,
|
|
padding: 0,
|
|
opacity: 0,
|
|
margin: token.calc(token.marginXS).div(-2).equal(),
|
|
},
|
|
});
|
|
|
|
const inlineCls = `${componentCls}-animate-inline`;
|
|
return [
|
|
{
|
|
[`${componentCls}-wrapper`]: {
|
|
[`${inlineCls}-appear, ${inlineCls}-enter, ${inlineCls}-leave`]: {
|
|
animationDuration: token.motionDurationSlow,
|
|
animationTimingFunction: token.motionEaseInOutCirc,
|
|
animationFillMode: 'forwards',
|
|
},
|
|
|
|
[`${inlineCls}-appear, ${inlineCls}-enter`]: {
|
|
animationName: uploadAnimateInlineIn,
|
|
},
|
|
|
|
[`${inlineCls}-leave`]: {
|
|
animationName: uploadAnimateInlineOut,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
[`${componentCls}-wrapper`]: initFadeMotion(token),
|
|
},
|
|
uploadAnimateInlineIn,
|
|
uploadAnimateInlineOut,
|
|
];
|
|
};
|
|
|
|
export default genMotionStyle;
|