diff --git a/components/content/Img/Img.stories.ts b/components/content/Img/Img.stories.ts index 11a98df..c4a36a9 100644 --- a/components/content/Img/Img.stories.ts +++ b/components/content/Img/Img.stories.ts @@ -26,7 +26,7 @@ export const Img: StoryObj = { object-position="${args.objectPosition}" > Placeholder ${page ? html` -

${page?.title}

-

${page?.description}

+ +

${page?.title}

+

${page?.description}

+
` : html`

@@ -129,81 +142,85 @@ export class DocsLoadingPage extends LitElement { - ${cards + ${cards.length ? cards.map( (card) => html` - - ${card.image.alt} - + + + ${card.image.alt} + -

${card.title}

-

- ${card.description} -

+

${card.title}

+

+ ${card.description} +

- - - + + + +
`, ) : [1, 2, 3, 4].map( - () => html` + (i) => html` - - - - -

- - Card title - -

-

- - Lorem ipsum dolor consequit sit amet epsilon evitcus - smartrum. - -

- - - Button text - - -
+ + + + + +

+ + Card title + +

+

+ + Lorem ipsum dolor consequit sit amet epsilon + evitcus smartrum. + +

+ + + Button text + + +
+
`, )} diff --git a/docs/recipes/LoadingSkeleton.stories.ts b/docs/recipes/LoadingSkeleton.stories.ts index b8b3cf9..248156d 100644 --- a/docs/recipes/LoadingSkeleton.stories.ts +++ b/docs/recipes/LoadingSkeleton.stories.ts @@ -5,6 +5,7 @@ import './LoadingPage'; import '../../components/content/LoadingImg/LoadingImg'; import '../../components/content/LoadingText/LoadingText'; import '../../components/content/LoadingButton/LoadingButton'; +import '../../components/composition/Enter/Enter'; export default { title: 'Recipes/Loading Skeleton', diff --git a/example/index.html b/example/index.html index 9c93283..2da23d8 100644 --- a/example/index.html +++ b/example/index.html @@ -11,7 +11,7 @@ - placeholder + placeholder

Card title

diff --git a/lib/pulse.ts b/lib/pulse.ts index 6859602..dacd5d3 100644 --- a/lib/pulse.ts +++ b/lib/pulse.ts @@ -1,6 +1,16 @@ import { css } from 'lit'; export const pulse = css` + @keyframes fade-in { + from { + opacity: 0; + } + + to { + opacity: 1; + } + } + @keyframes pulse { 0% { background-position: 200% 0; @@ -12,8 +22,11 @@ export const pulse = css` } :host { - animation: pulse var(--diamond-transition-duration-pulse) infinite - var(--diamond-transition-timing-pulse); + animation: + fade-in var(--diamond-transition-duration-enter) forwards + var(--diamond-transition-timing-enter) var(--diamond-loading-delay), + pulse var(--diamond-transition-duration-pulse) infinite + var(--diamond-transition-timing-pulse); appearance: none; background: linear-gradient( to right, @@ -25,6 +38,7 @@ export const pulse = css` background-size: 200% 100%; color: transparent; display: inline-block; + opacity: 0; pointer-events: none; user-select: none; } diff --git a/styles/tokens.css b/styles/tokens.css index 14c7f8d..c46c1b2 100644 --- a/styles/tokens.css +++ b/styles/tokens.css @@ -5,6 +5,7 @@ @import url('./tokens/icon.css'); @import url('./tokens/input.css'); @import url('./tokens/label.css'); +@import url('./tokens/loading.css'); @import url('./tokens/radius.css'); @import url('./tokens/shadow.css'); @import url('./tokens/spacing.css'); diff --git a/styles/tokens/loading.css b/styles/tokens/loading.css new file mode 100644 index 0000000..6a11cea --- /dev/null +++ b/styles/tokens/loading.css @@ -0,0 +1,3 @@ +:root { + --diamond-loading-delay: 0.5s; +}