diff --git a/change/@fluentui-react-skeleton-9e800ca2-9155-4112-9add-68393df30fe7.json b/change/@fluentui-react-skeleton-9e800ca2-9155-4112-9add-68393df30fe7.json new file mode 100644 index 00000000000000..815eb720b99cba --- /dev/null +++ b/change/@fluentui-react-skeleton-9e800ca2-9155-4112-9add-68393df30fe7.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "fix: Scale pulse animation with percentages and flip wave animation's direction.", + "packageName": "@fluentui/react-skeleton", + "email": "ololubek@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-components/react-skeleton/src/components/SkeletonItem/useSkeletonItemStyles.styles.ts b/packages/react-components/react-skeleton/src/components/SkeletonItem/useSkeletonItemStyles.styles.ts index 0476bc5c510a85..e20e9009204cae 100644 --- a/packages/react-components/react-skeleton/src/components/SkeletonItem/useSkeletonItemStyles.styles.ts +++ b/packages/react-components/react-skeleton/src/components/SkeletonItem/useSkeletonItemStyles.styles.ts @@ -8,7 +8,7 @@ export const skeletonItemClassNames: SlotClassNames = { root: 'fui-SkeletonItem', }; -const skeletonWaveAnimationRTL = { +const skeletonWaveAnimation = { from: { backgroundPositionX: '300% /* @noflip */', }, @@ -17,7 +17,7 @@ const skeletonWaveAnimationRTL = { }, }; -const skeletonWaveAnimation = { +const skeletonWaveAnimationRTL = { from: { backgroundPositionX: '0% /* @noflip */', }, @@ -27,12 +27,15 @@ const skeletonWaveAnimation = { }; const skeletonPulseAnimation = { - from: { + '0%': { opacity: '1', }, - to: { + '50%': { opacity: '0.4', }, + '100%': { + opacity: '1', + }, }; /** @@ -63,9 +66,18 @@ const useStyles = makeStyles({ }, waveRtl: { animationName: skeletonWaveAnimationRTL, + backgroundImage: `linear-gradient( + to right, + ${tokens.colorNeutralStencil1} 0%, + ${tokens.colorNeutralStencil2} 50%, + ${tokens.colorNeutralStencil1} 100%)`, + '@media screen and (forced-colors: active)': { + backgroundColor: 'WindowText', + }, }, pulse: { animationName: skeletonPulseAnimation, + animationDuration: '1s', backgroundColor: tokens.colorNeutralStencil1, }, translucent: {