feat(core): remove loop animations (#8242)

This commit is contained in:
EYHN
2024-09-13 09:54:23 +00:00
parent 3c1cd6b648
commit 6fde967a6d
6 changed files with 13 additions and 128 deletions

View File

@@ -1,7 +1,8 @@
import { assignInlineVars } from '@vanilla-extract/dynamic';
import clsx from 'clsx';
import { withUnit } from '../../utils/with-unit';
import { loading, speedVar } from './styles.css';
import { loading, rotateAnimation, speedVar } from './styles.css';
export interface LoadingProps {
size?: number | string;
@@ -18,7 +19,7 @@ export const Loading = ({
const sizeWithUnit = size ? withUnit(size, 'px') : '16px';
return (
<svg
className={loading}
className={clsx(loading, speed !== 0 && rotateAnimation)}
width={sizeWithUnit}
height={sizeWithUnit}
viewBox="0 0 24 24"

View File

@@ -12,10 +12,12 @@ const rotate = keyframes({
},
});
export const loading = style({
transform: 'rotate(-90deg)',
});
export const rotateAnimation = style({
vars: {
[speedVar]: '1.5s',
},
textRendering: 'optimizeLegibility',
transform: 'rotate(-90deg)',
animation: `${rotate} ${speedVar} infinite linear`,
});