Skip to content

Commit

Permalink
feat: introduce the Skeleton component
Browse files Browse the repository at this point in the history
  • Loading branch information
isqua committed Oct 23, 2023
1 parent 20d074f commit ae06754
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/components/Skeleton/Skeleton.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.skeleton {
display: block;
animation: loading 2s infinite;
background-color: var(--color-secondary-background);
pointer-events: none;
}

.skeleton::before {
content: '\00a0';
}

@keyframes loading {
0% {
background-color: var(--color-secondary-background);
}

50% {
background-color: var(--color-tertiary-background);
}

100% {
background-color: var(--color-secondary-background);
}
}
13 changes: 13 additions & 0 deletions src/components/Skeleton/Skeleton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import clsx from 'clsx'

import styles from './Skeleton.module.css'

type SkeletonProps = {
className?: string
}

export function Skeleton({ className }: SkeletonProps) {
return (
<span className={clsx(styles.skeleton, className)} />
)
}
1 change: 1 addition & 0 deletions src/components/Skeleton/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Skeleton } from './Skeleton'

0 comments on commit ae06754

Please sign in to comment.