mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: skeletons
This commit is contained in:
1 parent
8f1017195f
commit
9257ebdd1e
2 files changed
+19
No files matched your search
@@ -0,0 +1,13 @@
|
|||||||
|
import { slateDarkA } from '@radix-ui/colors';
|
||||||
|
import { keyframes, style } from '@vanilla-extract/css';
|
||||||
|
|
||||||
|
const animation = keyframes({
|
||||||
|
'0%': { backgroundColor: slateDarkA.slateA2 },
|
||||||
|
'50%': { backgroundColor: slateDarkA.slateA3 },
|
||||||
|
'100%': { backgroundColor: slateDarkA.slateA2 },
|
||||||
|
});
|
||||||
|
|
||||||
|
export const skeleton = style({
|
||||||
|
borderRadius: 8,
|
||||||
|
animation: `${animation} 2s ease-in-out infinite`,
|
||||||
|
});
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import { ComponentProps } from 'react';
|
||||||
|
import { skeleton } from './index.css';
|
||||||
|
|
||||||
|
export function Skeleton({ className, ...props }: ComponentProps<'div'>) {
|
||||||
|
return <div {...props} className={`${className} ${skeleton}`} />;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user