-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: introduce the Skeleton component
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)} /> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { Skeleton } from './Skeleton' |