fix: active skeleton safari problem (#40692)

This commit is contained in:
slotDumpling 2023-02-15 16:52:48 +08:00 committed by GitHub
parent 910d0fc340
commit 6234509d18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,10 +10,10 @@ export type ComponentToken = {
const skeletonClsLoading = new Keyframes(`ant-skeleton-loading`, {
'0%': {
transform: 'translateX(-37.5%)',
backgroundPosition: '100% 50%',
},
'100%': {
transform: 'translateX(37.5%)',
backgroundPosition: '0 50%',
},
});
@ -45,26 +45,12 @@ const genSkeletonElementAvatarSize = (size: number): CSSObject => ({
});
const genSkeletonColor = (token: SkeletonToken): CSSObject => ({
position: 'relative',
// fix https://github.com/ant-design/ant-design/issues/36444
// https://monshin.github.io/202109/css/safari-border-radius-overflow-hidden/
/* stylelint-disable-next-line property-no-vendor-prefix,value-no-vendor-prefix */
zIndex: 0,
overflow: 'hidden',
background: 'transparent',
'&::after': {
position: 'absolute',
top: 0,
insetInlineEnd: '-150%',
bottom: 0,
insetInlineStart: '-150%',
background: token.skeletonLoadingBackground,
animationName: skeletonClsLoading,
animationDuration: token.skeletonLoadingMotionDuration,
animationTimingFunction: 'ease',
animationIterationCount: 'infinite',
content: '""',
},
background: token.skeletonLoadingBackground,
backgroundSize: '400% 100%',
animationName: skeletonClsLoading,
animationDuration: token.skeletonLoadingMotionDuration,
animationTimingFunction: 'ease',
animationIterationCount: 'infinite',
});
const genSkeletonElementInputSize = (size: number): CSSObject => ({