forked from eBay/skin
-
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.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
eaa8997
commit 6f8e2cc
Showing
51 changed files
with
4,385 additions
and
7 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,169 @@ | ||
.skeleton { | ||
container-name: skeleton-container; | ||
container-type: inline-size; | ||
cursor: progress; | ||
width: 100%; | ||
} | ||
.skeleton__avatar, | ||
.skeleton__button, | ||
.skeleton__text, | ||
.skeleton__image, | ||
.skeleton__textbox { | ||
background: var(--skeleton-background, var(--color-loading-fill)); | ||
width: 100%; | ||
} | ||
.skeleton__avatar { | ||
border-radius: var(--avatar-border-radius, 50%); | ||
height: 48px; | ||
width: 48px; | ||
} | ||
.skeleton__button { | ||
border-radius: var(--btn-border-radius, calc(40px / 2)); | ||
height: 40px; | ||
} | ||
.skeleton__button--small { | ||
border-radius: var(--btn-border-radius, calc(32px / 2)); | ||
height: 32px; | ||
} | ||
.skeleton__button--large { | ||
border-radius: var(--btn-border-radius, calc(48px / 2)); | ||
height: 48px; | ||
} | ||
.skeleton__text { | ||
border-radius: var(--text-border-radius, 3px); | ||
height: 16px; | ||
width: calc(100% - var(--spacing-300)); | ||
} | ||
.skeleton__text::after { | ||
height: 16px; | ||
margin-top: calc(16px + var(--spacing-100)); | ||
} | ||
.skeleton__text--large { | ||
height: 24px; | ||
} | ||
.skeleton__text--large::after { | ||
height: 24px; | ||
margin-top: calc(24px + var(--spacing-100)); | ||
} | ||
.skeleton__text--multiline { | ||
margin-bottom: var(--spacing-300); | ||
position: relative; | ||
width: calc(100% - var(--spacing-300)); | ||
} | ||
.skeleton__text--multiline::after { | ||
background: inherit; | ||
content: ""; | ||
position: absolute; | ||
width: calc(100% - var(--spacing-700)); | ||
} | ||
.skeleton__text--large.skeleton__text--multiline { | ||
margin-bottom: var(--spacing-400); | ||
} | ||
.skeleton__textbox { | ||
border-radius: var(--textbox-border-radius, var(--border-radius-50)); | ||
height: 48px; | ||
} | ||
.skeleton__image { | ||
border-radius: var(--image-border-radius, var(--border-radius-50)); | ||
height: 100%; | ||
max-width: initial; | ||
} | ||
.skeleton__image::after { | ||
bottom: 0; | ||
height: 100%; | ||
left: 0; | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
width: 100%; | ||
} | ||
span.skeleton__avatar, | ||
span.skeleton__button, | ||
span.skeleton__text, | ||
span.skeleton__image, | ||
span.skeleton__textbox { | ||
display: inline-block; | ||
} | ||
span.skeleton__avatar + span, | ||
span.skeleton__button + span, | ||
span.skeleton__text + span, | ||
span.skeleton__image + span, | ||
span.skeleton__textbox + span { | ||
-webkit-margin-start: var(--spacing-100); | ||
margin-inline-start: var(--spacing-100); | ||
} | ||
div.skeleton__avatar, | ||
div.skeleton__button, | ||
div.skeleton__text, | ||
div.skeleton__image, | ||
div.skeleton__textbox { | ||
-webkit-margin-before: var(--spacing-150); | ||
margin-block-start: var(--spacing-150); | ||
} | ||
.skeleton--elevated { | ||
--skeleton-background: var(--color-loading-fill-elevated); | ||
} | ||
@media screen and (max-width: 512px) { | ||
.skeleton { | ||
--skeleton-background: var(--color-loading-shimmer); | ||
} | ||
.skeleton--elevated { | ||
--skeleton-background: var(--color-loading-shimmer-elevated); | ||
} | ||
} | ||
.skeleton--purple { | ||
--skeleton-background: var(--color-loading-ai-gradient-purple-subtle); | ||
} | ||
.skeleton--green { | ||
--skeleton-background: var(--color-loading-ai-gradient-green-subtle); | ||
} | ||
.skeleton--blue { | ||
--skeleton-background: var(--color-loading-ai-gradient-blue-subtle); | ||
} | ||
@media (prefers-reduced-motion: no-preference) { | ||
@keyframes loading-frames { | ||
0% { | ||
background-position: 0% 0%; | ||
} | ||
50% { | ||
background-position: 45% 0%; | ||
} | ||
100% { | ||
background-position: 90% 0%; | ||
} | ||
} | ||
@keyframes fade-in { | ||
0% { | ||
opacity: 0; | ||
} | ||
100% { | ||
opacity: 1; | ||
} | ||
} | ||
.skeleton__avatar, | ||
.skeleton__button, | ||
.skeleton__text, | ||
.skeleton__image, | ||
.skeleton__textbox { | ||
/* setting animation-iteration-count to 6 (5000/833ms) */ | ||
/* so it does not exceed 5s per WCAG 2.2.2 */ | ||
animation: fade-in 500ms forwards, loading-frames 833ms 667ms linear 6; | ||
animation-fill-mode: both; | ||
background-size: 200%; | ||
} | ||
} | ||
@container skeleton-container (width > 79px) { | ||
.skeleton__image { | ||
border-radius: var(--image-border-radius, var(--border-radius-100)); | ||
} | ||
} | ||
[dir="rtl"] .skeleton__avatar, | ||
[dir="rtl"] .skeleton__button, | ||
[dir="rtl"] .skeleton__text, | ||
[dir="rtl"] .skeleton__image, | ||
[dir="rtl"] .skeleton__textbox { | ||
animation-direction: normal, reverse; | ||
} | ||
[dir="rtl"] .skeleton__text--multiline::after { | ||
left: var(--spacing-700); | ||
} |
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 |
---|---|---|
|
@@ -121,5 +121,6 @@ | |
--spacing-400: 32px; | ||
--spacing-450: 36px; | ||
--spacing-600: 48px; | ||
--spacing-700: 56px; | ||
--spacing-800: 64px; | ||
} |
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
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
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
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
Oops, something went wrong.