Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix the flex gap problem #48522

Merged
merged 1 commit into from
Apr 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 21 additions & 20 deletions components/upload/style/motion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,31 @@ import type { UploadToken } from '.';
import { initFadeMotion } from '../../style/motion';
import type { GenerateStyle } from '../../theme/internal';

const uploadAnimateInlineIn = new Keyframes('uploadAnimateInlineIn', {
from: {
width: 0,
height: 0,
margin: 0,
padding: 0,
opacity: 0,
},
});

const uploadAnimateInlineOut = new Keyframes('uploadAnimateInlineOut', {
to: {
width: 0,
height: 0,
margin: 0,
padding: 0,
opacity: 0,
},
});
// =========================== Motion ===========================
const genMotionStyle: GenerateStyle<UploadToken> = (token) => {
const { componentCls } = token;
const inlineCls = `${componentCls}-animate-inline`;

const uploadAnimateInlineIn = new Keyframes('uploadAnimateInlineIn', {
from: {
width: 0,
height: 0,
padding: 0,
opacity: 0,
margin: `calc(${token.marginXS} / -2)`,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

token.calc(token.marginXS).div(-2).equal()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

数值模式下会直接计算

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So should I make a new PR for this?

},
});

const uploadAnimateInlineOut = new Keyframes('uploadAnimateInlineOut', {
to: {
width: 0,
height: 0,
padding: 0,
opacity: 0,
margin: `calc(${token.marginXS} / -2)`,
},
});

const inlineCls = `${componentCls}-animate-inline`;
return [
{
[`${componentCls}-wrapper`]: {
Expand Down