mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
using a [babel plugin](https://gist.github.com/pengx17/49e24ae8a5a609bdaff122ee8c679d1c) to transform all var(--affine-xxx) to cssVar Some issues: - tried ast-grep but it seems to be not easy to add imports conditionally - current work does not work well with ts with types because babel will strip them out
22 lines
489 B
TypeScript
22 lines
489 B
TypeScript
import { createVar, keyframes, style } from '@vanilla-extract/css';
|
|
export const speedVar = createVar('speedVar');
|
|
const rotate = keyframes({
|
|
'0%': {
|
|
transform: 'rotate(0deg)',
|
|
},
|
|
'50%': {
|
|
transform: 'rotate(180deg)',
|
|
},
|
|
'100%': {
|
|
transform: 'rotate(360deg)',
|
|
},
|
|
});
|
|
export const loading = style({
|
|
vars: {
|
|
[speedVar]: '1.5s',
|
|
},
|
|
textRendering: 'optimizeLegibility',
|
|
transform: 'rotate(-90deg)',
|
|
animation: `${rotate} ${speedVar} infinite linear`,
|
|
});
|