@justeattakeaway/pie-skeleton 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/index.js +19 -19
- package/package.json +3 -3
- package/src/skeleton.scss +72 -5
package/README.md
CHANGED
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
- [Events](#events)
|
|
20
20
|
- [Usage Examples](#usage-examples)
|
|
21
21
|
- [Avoiding layout shift](#avoiding-layout-shift)
|
|
22
|
+
- [Animation](#animation)
|
|
23
|
+
- [Reduced motion](#reduced-motion)
|
|
22
24
|
- [Questions and Support](#questions-and-support)
|
|
23
25
|
- [Contributing](#contributing)
|
|
24
26
|
|
|
@@ -130,6 +132,10 @@ A skeleton's job is to reserve the space of the content it stands in for, so the
|
|
|
130
132
|
- **Reserve space on the container.** A fixed or minimum height (or aspect ratio) on the container stops small differences inside it from moving content outside it.
|
|
131
133
|
- **Small mismatches add up.** One 4px difference is negligible (around 0.003 CLS), but the same difference repeated across a list of 10 cards can reach around 0.04 — almost half of the 0.1 "good" threshold.
|
|
132
134
|
|
|
135
|
+
### Reduced motion
|
|
136
|
+
|
|
137
|
+
When the user has requested reduced motion (`prefers-reduced-motion: reduce`), the shimmer animation is removed and the skeleton is shown as a static placeholder.
|
|
138
|
+
|
|
133
139
|
## Questions and Support
|
|
134
140
|
|
|
135
141
|
If you work at Just Eat Takeaway.com, please contact us on **#help-designsystem**. Otherwise, please raise an issue on [Github](https://github.com/justeattakeaway/pie/issues).
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { LitElement as
|
|
2
|
-
import { validPropertyValues as
|
|
3
|
-
import { classMap as
|
|
1
|
+
import { LitElement as x, unsafeCSS as b, html as p, nothing as u } from "lit";
|
|
2
|
+
import { validPropertyValues as h, safeCustomElement as k } from "@justeattakeaway/pie-webc-core";
|
|
3
|
+
import { classMap as m } from "lit/directives/class-map.js";
|
|
4
4
|
import { property as d } from "lit/decorators.js";
|
|
5
|
-
const f = class f extends
|
|
5
|
+
const f = class f extends x {
|
|
6
6
|
willUpdate() {
|
|
7
7
|
this.getAttribute("v") || this.setAttribute("v", f.v);
|
|
8
8
|
}
|
|
9
9
|
};
|
|
10
|
-
f.v = "0.
|
|
11
|
-
let
|
|
12
|
-
const y = `@charset "UTF-8";*,*:after,*:before{box-sizing:inherit}:host{display:block;pointer-events:none}.c-skeleton{--skeleton-bg: var(--dt-color-skeleton-01);--skeleton-border-radius: var(--dt-radius-rounded-b);--skeleton-text-radius: var(--dt-radius-rounded-a);--skeleton-star-size: var(--dt-spacing-e);position:relative;overflow:hidden;width:100%}.c-skeleton--backgroundDefault{--skeleton-bg: var(--dt-color-skeleton-01)}.c-skeleton--backgroundStrong{--skeleton-bg: var(--dt-color-skeleton-02)}.c-skeleton--backgroundSubtle{--skeleton-bg: var(--dt-color-skeleton-03)}.c-skeleton--box,.c-skeleton--circle,.c-skeleton--pill,.c-skeleton-star{background-color:var(--skeleton-bg)}.c-skeleton--box{border-radius:var(--skeleton-border-radius)}.c-skeleton--radius-rounded-none{--skeleton-border-radius: var(--dt-radius-rounded-none)}.c-skeleton--radius-rounded-a{--skeleton-border-radius: var(--dt-radius-rounded-a)}.c-skeleton--radius-rounded-b{--skeleton-border-radius: var(--dt-radius-rounded-b)}.c-skeleton--radius-rounded-c{--skeleton-border-radius: var(--dt-radius-rounded-c)}.c-skeleton--radius-rounded-d{--skeleton-border-radius: var(--dt-radius-rounded-d)}.c-skeleton--radius-rounded-e{--skeleton-border-radius: var(--dt-radius-rounded-e)}.c-skeleton--radius-rounded-f{--skeleton-border-radius: var(--dt-radius-rounded-f)}.c-skeleton--radius-rounded-g{--skeleton-border-radius: var(--dt-radius-rounded-g)}.c-skeleton--1by1{aspect-ratio:1/1}.c-skeleton--4by3{aspect-ratio:4/3}.c-skeleton--16by9{aspect-ratio:16/9}.c-skeleton--3by4{aspect-ratio:3/4}.c-skeleton--9by16{aspect-ratio:9/16}.c-skeleton--circle{border-radius:50%;aspect-ratio:1/1}.c-skeleton--pill{box-sizing:border-box;border-radius:var(--dt-radius-rounded-e)}.c-skeleton--button-xsmall{--btn-padding-vertical-xsmall: 6px;--btn-padding-vertical-small-expressive: 8px;--btn-padding-vertical-small-productive: 10px;--btn-padding-vertical-medium: 12px;--btn-padding-vertical-large: 16px;--btn-padding-horizontal-small: var(--dt-spacing-b);--btn-padding-horizontal-medium: var(--dt-spacing-d);--btn-padding-horizontal-large: var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-interactive-xs-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-xs-line-height) * 1px);--btn-icon-size: 16px;--icon-size-override: 16px;padding:var(--btn-padding-vertical-xsmall) var(--btn-padding-horizontal-small)}@media(min-width:769px){.c-skeleton--button-xsmall.c-skeleton--responsive{--btn-font-size: calc(var(--dt-font-interactive-s-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-s-line-height) * 1px);--btn-icon-size: 20px;--icon-size-override: 20px;padding:var(--btn-padding-vertical-small-productive) var(--btn-padding-horizontal-medium)}.c-skeleton--button-xsmall.c-skeleton--responsive.c-skeleton--expressive{--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 20px;--icon-size-override: 20px;padding:var(--btn-padding-vertical-small-expressive) var(--btn-padding-horizontal-medium)}}.c-skeleton--button-xsmall.c-skeleton--outline,.c-skeleton--button-xsmall.c-skeleton--outline-inverse{padding:calc(var(--btn-padding-vertical-xsmall) - 1px) var(--btn-padding-horizontal-small)}@media(min-width:769px){.c-skeleton--button-xsmall.c-skeleton--outline.c-skeleton--responsive,.c-skeleton--button-xsmall.c-skeleton--outline-inverse.c-skeleton--responsive{padding:calc(var(--btn-padding-vertical-small-productive) - 1px) var(--btn-padding-horizontal-medium)}.c-skeleton--button-xsmall.c-skeleton--outline.c-skeleton--responsive.c-skeleton--expressive,.c-skeleton--button-xsmall.c-skeleton--outline-inverse.c-skeleton--responsive.c-skeleton--expressive{padding:calc(var(--btn-padding-vertical-small-expressive) - 1px) var(--btn-padding-horizontal-medium)}}.c-skeleton--button-xsmall{line-height:var(--btn-line-height)}.c-skeleton--button-xsmall:before{content:""}.c-skeleton--button-small-productive{--btn-padding-vertical-xsmall: 6px;--btn-padding-vertical-small-expressive: 8px;--btn-padding-vertical-small-productive: 10px;--btn-padding-vertical-medium: 12px;--btn-padding-vertical-large: 16px;--btn-padding-horizontal-small: var(--dt-spacing-b);--btn-padding-horizontal-medium: var(--dt-spacing-d);--btn-padding-horizontal-large: var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-interactive-s-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-s-line-height) * 1px);--btn-icon-size: 20px;--icon-size-override: 20px;padding:var(--btn-padding-vertical-small-productive) var(--btn-padding-horizontal-medium)}@media(min-width:769px){.c-skeleton--button-small-productive.c-skeleton--responsive{--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 24px;--icon-size-override: 24px;padding:var(--btn-padding-vertical-medium) var(--btn-padding-horizontal-large)}}.c-skeleton--button-small-productive.c-skeleton--outline,.c-skeleton--button-small-productive.c-skeleton--outline-inverse{padding:calc(var(--btn-padding-vertical-small-productive) - 1px) var(--btn-padding-horizontal-medium)}@media(min-width:769px){.c-skeleton--button-small-productive.c-skeleton--outline.c-skeleton--responsive,.c-skeleton--button-small-productive.c-skeleton--outline-inverse.c-skeleton--responsive{padding:calc(var(--btn-padding-vertical-medium) - 1px) var(--btn-padding-horizontal-large)}}.c-skeleton--button-small-productive{line-height:var(--btn-line-height)}.c-skeleton--button-small-productive:before{content:""}.c-skeleton--button-small-expressive{--btn-padding-vertical-xsmall: 6px;--btn-padding-vertical-small-expressive: 8px;--btn-padding-vertical-small-productive: 10px;--btn-padding-vertical-medium: 12px;--btn-padding-vertical-large: 16px;--btn-padding-horizontal-small: var(--dt-spacing-b);--btn-padding-horizontal-medium: var(--dt-spacing-d);--btn-padding-horizontal-large: var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 20px;--icon-size-override: 20px;padding:var(--btn-padding-vertical-small-expressive) var(--btn-padding-horizontal-medium)}@media(min-width:769px){.c-skeleton--button-small-expressive.c-skeleton--responsive{--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 24px;--icon-size-override: 24px;padding:var(--btn-padding-vertical-medium) var(--btn-padding-horizontal-large)}}.c-skeleton--button-small-expressive.c-skeleton--outline,.c-skeleton--button-small-expressive.c-skeleton--outline-inverse{padding:calc(var(--btn-padding-vertical-small-expressive) - 1px) var(--btn-padding-horizontal-medium)}@media(min-width:769px){.c-skeleton--button-small-expressive.c-skeleton--outline.c-skeleton--responsive,.c-skeleton--button-small-expressive.c-skeleton--outline-inverse.c-skeleton--responsive{padding:calc(var(--btn-padding-vertical-medium) - 1px) var(--btn-padding-horizontal-large)}}.c-skeleton--button-small-expressive{line-height:var(--btn-line-height)}.c-skeleton--button-small-expressive:before{content:""}.c-skeleton--button-medium{--btn-padding-vertical-xsmall: 6px;--btn-padding-vertical-small-expressive: 8px;--btn-padding-vertical-small-productive: 10px;--btn-padding-vertical-medium: 12px;--btn-padding-vertical-large: 16px;--btn-padding-horizontal-small: var(--dt-spacing-b);--btn-padding-horizontal-medium: var(--dt-spacing-d);--btn-padding-horizontal-large: var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 24px;--icon-size-override: 24px;padding:var(--btn-padding-vertical-medium) var(--btn-padding-horizontal-large)}@media(min-width:769px){.c-skeleton--button-medium.c-skeleton--responsive{--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 24px;--icon-size-override: 24px;padding:var(--btn-padding-vertical-large) var(--btn-padding-horizontal-large)}}.c-skeleton--button-medium.c-skeleton--outline,.c-skeleton--button-medium.c-skeleton--outline-inverse{padding:calc(var(--btn-padding-vertical-medium) - 1px) var(--btn-padding-horizontal-large)}@media(min-width:769px){.c-skeleton--button-medium.c-skeleton--outline.c-skeleton--responsive,.c-skeleton--button-medium.c-skeleton--outline-inverse.c-skeleton--responsive{padding:calc(var(--btn-padding-vertical-large) - 1px) var(--btn-padding-horizontal-large)}}.c-skeleton--button-medium{line-height:var(--btn-line-height)}.c-skeleton--button-medium:before{content:""}.c-skeleton--button-large{--btn-padding-vertical-xsmall: 6px;--btn-padding-vertical-small-expressive: 8px;--btn-padding-vertical-small-productive: 10px;--btn-padding-vertical-medium: 12px;--btn-padding-vertical-large: 16px;--btn-padding-horizontal-small: var(--dt-spacing-b);--btn-padding-horizontal-medium: var(--dt-spacing-d);--btn-padding-horizontal-large: var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 24px;--icon-size-override: 24px;padding:var(--btn-padding-vertical-large) var(--btn-padding-horizontal-large)}.c-skeleton--button-large.c-skeleton--outline,.c-skeleton--button-large.c-skeleton--outline-inverse{padding:calc(var(--btn-padding-vertical-large) - 1px) var(--btn-padding-horizontal-large)}.c-skeleton--button-large{line-height:var(--btn-line-height)}.c-skeleton--button-large:before{content:""}.c-skeleton-line{font-family:var(--dt-font-body-l-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-l-weight);font-size:calc(var(--dt-font-body-l-size) * 1px);line-height:calc(var(--dt-font-body-l-line-height) * 1px);position:relative;border-radius:var(--skeleton-text-radius)}.c-skeleton-line:before{content:""}.c-skeleton-line:after{content:"";position:absolute;inset-inline:0;inset-block-start:50%;translate:0 -50%;block-size:1em;border-radius:var(--skeleton-text-radius);background-color:var(--skeleton-bg)}.c-skeleton-line.is-last:after{inset-inline-end:50%}.c-skeleton-line--font-heading-xs{font-family:var(--dt-font-heading-xs-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-xs-weight);font-size:calc(var(--dt-font-heading-xs-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-xs-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-xs{font-size:calc(var(--dt-font-heading-xs-size--wide) * 1px);line-height:calc(var(--dt-font-heading-xs-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-s{font-family:var(--dt-font-heading-s-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-s-weight);font-size:calc(var(--dt-font-heading-s-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-s-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-s{font-size:calc(var(--dt-font-heading-s-size--wide) * 1px);line-height:calc(var(--dt-font-heading-s-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-m{font-family:var(--dt-font-heading-m-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-m-weight);font-size:calc(var(--dt-font-heading-m-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-m-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-m{font-size:calc(var(--dt-font-heading-m-size--wide) * 1px);line-height:calc(var(--dt-font-heading-m-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-l{font-family:var(--dt-font-heading-l-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-l-weight);font-size:calc(var(--dt-font-heading-l-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-l-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-l{font-size:calc(var(--dt-font-heading-l-size--wide) * 1px);line-height:calc(var(--dt-font-heading-l-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-xl{font-family:var(--dt-font-heading-xl-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-xl-weight);font-size:calc(var(--dt-font-heading-xl-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-xl-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-xl{font-size:calc(var(--dt-font-heading-xl-size--wide) * 1px);line-height:calc(var(--dt-font-heading-xl-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-xxl{font-family:var(--dt-font-heading-xxl-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-xxl-weight);font-size:calc(var(--dt-font-heading-xxl-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-xxl-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-xxl{font-size:calc(var(--dt-font-heading-xxl-size--wide) * 1px);line-height:calc(var(--dt-font-heading-xxl-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-xs-italic{font-family:var(--dt-font-heading-xs-italic-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-xs-italic-weight);font-style:var(--dt-font-heading-xs-italic-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-heading-xs-italic-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-xs-italic-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-xs-italic{font-size:calc(var(--dt-font-heading-xs-italic-size--wide) * 1px);line-height:calc(var(--dt-font-heading-xs-italic-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-s-italic{font-family:var(--dt-font-heading-s-italic-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-s-italic-weight);font-style:var(--dt-font-heading-s-italic-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-heading-s-italic-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-s-italic-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-s-italic{font-size:calc(var(--dt-font-heading-s-italic-size--wide) * 1px);line-height:calc(var(--dt-font-heading-s-italic-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-m-italic{font-family:var(--dt-font-heading-m-italic-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-m-italic-weight);font-style:var(--dt-font-heading-m-italic-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-heading-m-italic-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-m-italic-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-m-italic{font-size:calc(var(--dt-font-heading-m-italic-size--wide) * 1px);line-height:calc(var(--dt-font-heading-m-italic-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-l-italic{font-family:var(--dt-font-heading-l-italic-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-l-italic-weight);font-style:var(--dt-font-heading-l-italic-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-heading-l-italic-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-l-italic-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-l-italic{font-size:calc(var(--dt-font-heading-l-italic-size--wide) * 1px);line-height:calc(var(--dt-font-heading-l-italic-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-xl-italic{font-family:var(--dt-font-heading-xl-italic-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-xl-italic-weight);font-style:var(--dt-font-heading-xl-italic-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-heading-xl-italic-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-xl-italic-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-xl-italic{font-size:calc(var(--dt-font-heading-xl-italic-size--wide) * 1px);line-height:calc(var(--dt-font-heading-xl-italic-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-xxl-italic{font-family:var(--dt-font-heading-xxl-italic-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-xxl-italic-weight);font-style:var(--dt-font-heading-xxl-italic-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-heading-xxl-italic-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-xxl-italic-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-xxl-italic{font-size:calc(var(--dt-font-heading-xxl-italic-size--wide) * 1px);line-height:calc(var(--dt-font-heading-xxl-italic-line-height--wide) * 1px)}}.c-skeleton-line--font-subheading-s{font-family:var(--dt-font-subheading-s-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-subheading-s-weight);font-size:calc(var(--dt-font-subheading-s-size--narrow) * 1px);line-height:calc(var(--dt-font-subheading-s-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-subheading-s{font-size:calc(var(--dt-font-subheading-s-size--wide) * 1px);line-height:calc(var(--dt-font-subheading-s-line-height--wide) * 1px)}}.c-skeleton-line--font-subheading-l{font-family:var(--dt-font-subheading-l-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-subheading-l-weight);font-size:calc(var(--dt-font-subheading-l-size--narrow) * 1px);line-height:calc(var(--dt-font-subheading-l-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-subheading-l{font-size:calc(var(--dt-font-subheading-l-size--wide) * 1px);line-height:calc(var(--dt-font-subheading-l-line-height--wide) * 1px)}}.c-skeleton-line--font-interactive-xs{font-family:var(--dt-font-interactive-xs-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-interactive-xs-weight);font-size:calc(var(--dt-font-interactive-xs-size) * 1px);line-height:calc(var(--dt-font-interactive-xs-line-height) * 1px)}.c-skeleton-line--font-interactive-s{font-family:var(--dt-font-interactive-s-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-interactive-s-weight);font-size:calc(var(--dt-font-interactive-s-size) * 1px);line-height:calc(var(--dt-font-interactive-s-line-height) * 1px)}.c-skeleton-line--font-interactive-l{font-family:var(--dt-font-interactive-l-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-interactive-l-weight);font-size:calc(var(--dt-font-interactive-l-size) * 1px);line-height:calc(var(--dt-font-interactive-l-line-height) * 1px)}.c-skeleton-line--font-body-s{font-family:var(--dt-font-body-s-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-s-weight);font-size:calc(var(--dt-font-body-s-size) * 1px);line-height:calc(var(--dt-font-body-s-line-height) * 1px)}.c-skeleton-line--font-body-s-link{font-family:var(--dt-font-body-s-link-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-s-link-weight);text-decoration:var(--dt-font-body-s-link-text-decoration);font-size:calc(var(--dt-font-body-s-link-size) * 1px);line-height:calc(var(--dt-font-body-s-link-line-height) * 1px)}.c-skeleton-line--font-body-l{font-family:var(--dt-font-body-l-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-l-weight);font-size:calc(var(--dt-font-body-l-size) * 1px);line-height:calc(var(--dt-font-body-l-line-height) * 1px)}.c-skeleton-line--font-body-l-link{font-family:var(--dt-font-body-l-link-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-l-link-weight);text-decoration:var(--dt-font-body-l-link-text-decoration);font-size:calc(var(--dt-font-body-l-link-size) * 1px);line-height:calc(var(--dt-font-body-l-link-line-height) * 1px)}.c-skeleton-line--font-body-strong-s{font-family:var(--dt-font-body-strong-s-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-strong-s-weight);font-size:calc(var(--dt-font-body-strong-s-size) * 1px);line-height:calc(var(--dt-font-body-strong-s-line-height) * 1px)}.c-skeleton-line--font-body-strong-s-link{font-family:var(--dt-font-body-strong-s-link-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-strong-s-link-weight);text-decoration:var(--dt-font-body-strong-s-link-text-decoration);font-size:calc(var(--dt-font-body-strong-s-link-size) * 1px);line-height:calc(var(--dt-font-body-strong-s-link-line-height) * 1px)}.c-skeleton-line--font-body-strong-l{font-family:var(--dt-font-body-strong-l-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-strong-l-weight);font-size:calc(var(--dt-font-body-strong-l-size) * 1px);line-height:calc(var(--dt-font-body-strong-l-line-height) * 1px)}.c-skeleton-line--font-body-strong-l-link{font-family:var(--dt-font-body-strong-l-link-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-strong-l-link-weight);text-decoration:var(--dt-font-body-strong-l-link-text-decoration);font-size:calc(var(--dt-font-body-strong-l-link-size) * 1px);line-height:calc(var(--dt-font-body-strong-l-link-line-height) * 1px)}.c-skeleton-line--font-caption{font-family:var(--dt-font-caption-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-caption-weight);font-size:calc(var(--dt-font-caption-size) * 1px);line-height:calc(var(--dt-font-caption-line-height) * 1px)}.c-skeleton-line--font-caption-link{font-family:var(--dt-font-caption-link-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-caption-link-weight);text-decoration:var(--dt-font-caption-link-text-decoration);font-size:calc(var(--dt-font-caption-link-size) * 1px);line-height:calc(var(--dt-font-caption-link-line-height) * 1px)}.c-skeleton-line--font-caption-strong{font-family:var(--dt-font-caption-strong-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-caption-strong-weight);font-size:calc(var(--dt-font-caption-strong-size) * 1px);line-height:calc(var(--dt-font-caption-strong-line-height) * 1px)}.c-skeleton-line--font-caption-strong-italic{font-family:var(--dt-font-caption-strong-italic-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-caption-strong-italic-weight);font-style:var(--dt-font-caption-strong-italic-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-caption-strong-italic-size) * 1px);line-height:calc(var(--dt-font-caption-strong-italic-line-height) * 1px)}.c-skeleton-line--font-caption-strong-link{font-family:var(--dt-font-caption-strong-link-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-caption-strong-link-weight);text-decoration:var(--dt-font-caption-strong-link-text-decoration);font-size:calc(var(--dt-font-caption-strong-link-size) * 1px);line-height:calc(var(--dt-font-caption-strong-link-line-height) * 1px)}.c-skeleton--star{display:flex;gap:0;width:fit-content}.c-skeleton-star{flex:0 0 auto;inline-size:var(--skeleton-star-size);block-size:var(--skeleton-star-size);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Cpath%20d='m12.288%2014.449-4.183-2.197a.22.22%200%200%200-.21%200L3.713%2014.45%204.5%209.794a.25.25%200%200%200%200-.193L1.07%206.302l4.673-.682a.23.23%200%200%200%20.166-.114L8%201.271l2.091%204.235a.23.23%200%200%200%20.167.114l4.672.682-3.386%203.3a.25.25%200%200%200-.061.192z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Cpath%20d='m12.288%2014.449-4.183-2.197a.22.22%200%200%200-.21%200L3.713%2014.45%204.5%209.794a.25.25%200%200%200%200-.193L1.07%206.302l4.673-.682a.23.23%200%200%200%20.166-.114L8%201.271l2.091%204.235a.23.23%200%200%200%20.167.114l4.672.682-3.386%203.3a.25.25%200%200%200-.061.192z'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}`, z = ["box", "circle", "pill", "text", "star"], w = ["default", "strong", "subtle"], _ = {
|
|
10
|
+
f.v = "0.2.0";
|
|
11
|
+
let v = f;
|
|
12
|
+
const y = `@charset "UTF-8";*,*:after,*:before{box-sizing:inherit}@keyframes skeletonShimmer{0%{background-position:150% 0}83.333%{background-position:-50% 0}to{background-position:-50% 0}}:host{display:block;pointer-events:none}.c-skeleton{--skeleton-bg: var(--dt-color-skeleton-01);--skeleton-border-radius: var(--dt-radius-rounded-b);--skeleton-text-radius: var(--dt-radius-rounded-a);--skeleton-star-size: var(--dt-spacing-e);--skeleton-shimmer: var(--dt-color-skeleton-shimmer-01);--skeleton-shimmer-color: color-mix(in srgb, var(--skeleton-shimmer) 50%, transparent);--skeleton-shimmer-duration: 1.2s;--skeleton-shimmer-direction: normal;position:relative;overflow:hidden;width:100%}:host(:dir(rtl)) .c-skeleton{--skeleton-shimmer-direction: reverse}.c-skeleton--backgroundDefault{--skeleton-bg: var(--dt-color-skeleton-01);--skeleton-shimmer: var(--dt-color-skeleton-shimmer-01)}.c-skeleton--backgroundStrong{--skeleton-bg: var(--dt-color-skeleton-02);--skeleton-shimmer: var(--dt-color-skeleton-shimmer-02)}.c-skeleton--backgroundSubtle{--skeleton-bg: var(--dt-color-skeleton-03);--skeleton-shimmer: var(--dt-color-skeleton-shimmer-03)}.c-skeleton--box,.c-skeleton--circle,.c-skeleton--pill,.c-skeleton-star{background-attachment:fixed;background-color:var(--skeleton-bg);background-image:linear-gradient(135deg,transparent 40%,var(--skeleton-shimmer-color) 50%,transparent 60%);background-position:150% 0;background-repeat:no-repeat;background-size:200% 100%;animation:skeletonShimmer var(--skeleton-shimmer-duration) linear infinite;animation-direction:var(--skeleton-shimmer-direction)}.c-skeleton--box{border-radius:var(--skeleton-border-radius)}.c-skeleton--radius-rounded-none{--skeleton-border-radius: var(--dt-radius-rounded-none)}.c-skeleton--radius-rounded-a{--skeleton-border-radius: var(--dt-radius-rounded-a)}.c-skeleton--radius-rounded-b{--skeleton-border-radius: var(--dt-radius-rounded-b)}.c-skeleton--radius-rounded-c{--skeleton-border-radius: var(--dt-radius-rounded-c)}.c-skeleton--radius-rounded-d{--skeleton-border-radius: var(--dt-radius-rounded-d)}.c-skeleton--radius-rounded-e{--skeleton-border-radius: var(--dt-radius-rounded-e)}.c-skeleton--radius-rounded-f{--skeleton-border-radius: var(--dt-radius-rounded-f)}.c-skeleton--radius-rounded-g{--skeleton-border-radius: var(--dt-radius-rounded-g)}.c-skeleton--1by1{aspect-ratio:1/1}.c-skeleton--4by3{aspect-ratio:4/3}.c-skeleton--16by9{aspect-ratio:16/9}.c-skeleton--3by4{aspect-ratio:3/4}.c-skeleton--9by16{aspect-ratio:9/16}.c-skeleton--circle{border-radius:50%;aspect-ratio:1/1}.c-skeleton--pill{box-sizing:border-box;border-radius:var(--dt-radius-rounded-e)}.c-skeleton--button-xsmall{--btn-padding-vertical-xsmall: 6px;--btn-padding-vertical-small-expressive: 8px;--btn-padding-vertical-small-productive: 10px;--btn-padding-vertical-medium: 12px;--btn-padding-vertical-large: 16px;--btn-padding-horizontal-small: var(--dt-spacing-b);--btn-padding-horizontal-medium: var(--dt-spacing-d);--btn-padding-horizontal-large: var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-interactive-xs-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-xs-line-height) * 1px);--btn-icon-size: 16px;--icon-size-override: 16px;padding:var(--btn-padding-vertical-xsmall) var(--btn-padding-horizontal-small)}@media(min-width:769px){.c-skeleton--button-xsmall.c-skeleton--responsive{--btn-font-size: calc(var(--dt-font-interactive-s-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-s-line-height) * 1px);--btn-icon-size: 20px;--icon-size-override: 20px;padding:var(--btn-padding-vertical-small-productive) var(--btn-padding-horizontal-medium)}.c-skeleton--button-xsmall.c-skeleton--responsive.c-skeleton--expressive{--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 20px;--icon-size-override: 20px;padding:var(--btn-padding-vertical-small-expressive) var(--btn-padding-horizontal-medium)}}.c-skeleton--button-xsmall.c-skeleton--outline,.c-skeleton--button-xsmall.c-skeleton--outline-inverse{padding:calc(var(--btn-padding-vertical-xsmall) - 1px) var(--btn-padding-horizontal-small)}@media(min-width:769px){.c-skeleton--button-xsmall.c-skeleton--outline.c-skeleton--responsive,.c-skeleton--button-xsmall.c-skeleton--outline-inverse.c-skeleton--responsive{padding:calc(var(--btn-padding-vertical-small-productive) - 1px) var(--btn-padding-horizontal-medium)}.c-skeleton--button-xsmall.c-skeleton--outline.c-skeleton--responsive.c-skeleton--expressive,.c-skeleton--button-xsmall.c-skeleton--outline-inverse.c-skeleton--responsive.c-skeleton--expressive{padding:calc(var(--btn-padding-vertical-small-expressive) - 1px) var(--btn-padding-horizontal-medium)}}.c-skeleton--button-xsmall{line-height:var(--btn-line-height)}.c-skeleton--button-xsmall:before{content:""}.c-skeleton--button-small-productive{--btn-padding-vertical-xsmall: 6px;--btn-padding-vertical-small-expressive: 8px;--btn-padding-vertical-small-productive: 10px;--btn-padding-vertical-medium: 12px;--btn-padding-vertical-large: 16px;--btn-padding-horizontal-small: var(--dt-spacing-b);--btn-padding-horizontal-medium: var(--dt-spacing-d);--btn-padding-horizontal-large: var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-interactive-s-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-s-line-height) * 1px);--btn-icon-size: 20px;--icon-size-override: 20px;padding:var(--btn-padding-vertical-small-productive) var(--btn-padding-horizontal-medium)}@media(min-width:769px){.c-skeleton--button-small-productive.c-skeleton--responsive{--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 24px;--icon-size-override: 24px;padding:var(--btn-padding-vertical-medium) var(--btn-padding-horizontal-large)}}.c-skeleton--button-small-productive.c-skeleton--outline,.c-skeleton--button-small-productive.c-skeleton--outline-inverse{padding:calc(var(--btn-padding-vertical-small-productive) - 1px) var(--btn-padding-horizontal-medium)}@media(min-width:769px){.c-skeleton--button-small-productive.c-skeleton--outline.c-skeleton--responsive,.c-skeleton--button-small-productive.c-skeleton--outline-inverse.c-skeleton--responsive{padding:calc(var(--btn-padding-vertical-medium) - 1px) var(--btn-padding-horizontal-large)}}.c-skeleton--button-small-productive{line-height:var(--btn-line-height)}.c-skeleton--button-small-productive:before{content:""}.c-skeleton--button-small-expressive{--btn-padding-vertical-xsmall: 6px;--btn-padding-vertical-small-expressive: 8px;--btn-padding-vertical-small-productive: 10px;--btn-padding-vertical-medium: 12px;--btn-padding-vertical-large: 16px;--btn-padding-horizontal-small: var(--dt-spacing-b);--btn-padding-horizontal-medium: var(--dt-spacing-d);--btn-padding-horizontal-large: var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 20px;--icon-size-override: 20px;padding:var(--btn-padding-vertical-small-expressive) var(--btn-padding-horizontal-medium)}@media(min-width:769px){.c-skeleton--button-small-expressive.c-skeleton--responsive{--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 24px;--icon-size-override: 24px;padding:var(--btn-padding-vertical-medium) var(--btn-padding-horizontal-large)}}.c-skeleton--button-small-expressive.c-skeleton--outline,.c-skeleton--button-small-expressive.c-skeleton--outline-inverse{padding:calc(var(--btn-padding-vertical-small-expressive) - 1px) var(--btn-padding-horizontal-medium)}@media(min-width:769px){.c-skeleton--button-small-expressive.c-skeleton--outline.c-skeleton--responsive,.c-skeleton--button-small-expressive.c-skeleton--outline-inverse.c-skeleton--responsive{padding:calc(var(--btn-padding-vertical-medium) - 1px) var(--btn-padding-horizontal-large)}}.c-skeleton--button-small-expressive{line-height:var(--btn-line-height)}.c-skeleton--button-small-expressive:before{content:""}.c-skeleton--button-medium{--btn-padding-vertical-xsmall: 6px;--btn-padding-vertical-small-expressive: 8px;--btn-padding-vertical-small-productive: 10px;--btn-padding-vertical-medium: 12px;--btn-padding-vertical-large: 16px;--btn-padding-horizontal-small: var(--dt-spacing-b);--btn-padding-horizontal-medium: var(--dt-spacing-d);--btn-padding-horizontal-large: var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 24px;--icon-size-override: 24px;padding:var(--btn-padding-vertical-medium) var(--btn-padding-horizontal-large)}@media(min-width:769px){.c-skeleton--button-medium.c-skeleton--responsive{--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 24px;--icon-size-override: 24px;padding:var(--btn-padding-vertical-large) var(--btn-padding-horizontal-large)}}.c-skeleton--button-medium.c-skeleton--outline,.c-skeleton--button-medium.c-skeleton--outline-inverse{padding:calc(var(--btn-padding-vertical-medium) - 1px) var(--btn-padding-horizontal-large)}@media(min-width:769px){.c-skeleton--button-medium.c-skeleton--outline.c-skeleton--responsive,.c-skeleton--button-medium.c-skeleton--outline-inverse.c-skeleton--responsive{padding:calc(var(--btn-padding-vertical-large) - 1px) var(--btn-padding-horizontal-large)}}.c-skeleton--button-medium{line-height:var(--btn-line-height)}.c-skeleton--button-medium:before{content:""}.c-skeleton--button-large{--btn-padding-vertical-xsmall: 6px;--btn-padding-vertical-small-expressive: 8px;--btn-padding-vertical-small-productive: 10px;--btn-padding-vertical-medium: 12px;--btn-padding-vertical-large: 16px;--btn-padding-horizontal-small: var(--dt-spacing-b);--btn-padding-horizontal-medium: var(--dt-spacing-d);--btn-padding-horizontal-large: var(--dt-spacing-e);--btn-font-size: calc(var(--dt-font-interactive-l-size) * 1px);--btn-line-height: calc(var(--dt-font-interactive-l-line-height) * 1px);--btn-icon-size: 24px;--icon-size-override: 24px;padding:var(--btn-padding-vertical-large) var(--btn-padding-horizontal-large)}.c-skeleton--button-large.c-skeleton--outline,.c-skeleton--button-large.c-skeleton--outline-inverse{padding:calc(var(--btn-padding-vertical-large) - 1px) var(--btn-padding-horizontal-large)}.c-skeleton--button-large{line-height:var(--btn-line-height)}.c-skeleton--button-large:before{content:""}.c-skeleton-line{font-family:var(--dt-font-body-l-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-l-weight);font-size:calc(var(--dt-font-body-l-size) * 1px);line-height:calc(var(--dt-font-body-l-line-height) * 1px);position:relative;border-radius:var(--skeleton-text-radius)}.c-skeleton-line:before{content:""}.c-skeleton-line:after{background-attachment:fixed;background-color:var(--skeleton-bg);background-image:linear-gradient(135deg,transparent 40%,var(--skeleton-shimmer-color) 50%,transparent 60%);background-position:150% 0;background-repeat:no-repeat;background-size:200% 100%;animation:skeletonShimmer var(--skeleton-shimmer-duration) linear infinite;animation-direction:var(--skeleton-shimmer-direction);content:"";position:absolute;inset-inline:0;inset-block-start:calc(50% - .5em);block-size:1em;border-radius:var(--skeleton-text-radius)}.c-skeleton-line.is-last:after{inset-inline-end:50%}.c-skeleton-line--font-heading-xs{font-family:var(--dt-font-heading-xs-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-xs-weight);font-size:calc(var(--dt-font-heading-xs-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-xs-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-xs{font-size:calc(var(--dt-font-heading-xs-size--wide) * 1px);line-height:calc(var(--dt-font-heading-xs-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-s{font-family:var(--dt-font-heading-s-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-s-weight);font-size:calc(var(--dt-font-heading-s-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-s-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-s{font-size:calc(var(--dt-font-heading-s-size--wide) * 1px);line-height:calc(var(--dt-font-heading-s-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-m{font-family:var(--dt-font-heading-m-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-m-weight);font-size:calc(var(--dt-font-heading-m-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-m-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-m{font-size:calc(var(--dt-font-heading-m-size--wide) * 1px);line-height:calc(var(--dt-font-heading-m-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-l{font-family:var(--dt-font-heading-l-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-l-weight);font-size:calc(var(--dt-font-heading-l-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-l-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-l{font-size:calc(var(--dt-font-heading-l-size--wide) * 1px);line-height:calc(var(--dt-font-heading-l-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-xl{font-family:var(--dt-font-heading-xl-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-xl-weight);font-size:calc(var(--dt-font-heading-xl-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-xl-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-xl{font-size:calc(var(--dt-font-heading-xl-size--wide) * 1px);line-height:calc(var(--dt-font-heading-xl-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-xxl{font-family:var(--dt-font-heading-xxl-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-xxl-weight);font-size:calc(var(--dt-font-heading-xxl-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-xxl-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-xxl{font-size:calc(var(--dt-font-heading-xxl-size--wide) * 1px);line-height:calc(var(--dt-font-heading-xxl-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-xs-italic{font-family:var(--dt-font-heading-xs-italic-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-xs-italic-weight);font-style:var(--dt-font-heading-xs-italic-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-heading-xs-italic-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-xs-italic-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-xs-italic{font-size:calc(var(--dt-font-heading-xs-italic-size--wide) * 1px);line-height:calc(var(--dt-font-heading-xs-italic-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-s-italic{font-family:var(--dt-font-heading-s-italic-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-s-italic-weight);font-style:var(--dt-font-heading-s-italic-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-heading-s-italic-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-s-italic-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-s-italic{font-size:calc(var(--dt-font-heading-s-italic-size--wide) * 1px);line-height:calc(var(--dt-font-heading-s-italic-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-m-italic{font-family:var(--dt-font-heading-m-italic-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-m-italic-weight);font-style:var(--dt-font-heading-m-italic-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-heading-m-italic-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-m-italic-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-m-italic{font-size:calc(var(--dt-font-heading-m-italic-size--wide) * 1px);line-height:calc(var(--dt-font-heading-m-italic-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-l-italic{font-family:var(--dt-font-heading-l-italic-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-l-italic-weight);font-style:var(--dt-font-heading-l-italic-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-heading-l-italic-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-l-italic-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-l-italic{font-size:calc(var(--dt-font-heading-l-italic-size--wide) * 1px);line-height:calc(var(--dt-font-heading-l-italic-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-xl-italic{font-family:var(--dt-font-heading-xl-italic-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-xl-italic-weight);font-style:var(--dt-font-heading-xl-italic-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-heading-xl-italic-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-xl-italic-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-xl-italic{font-size:calc(var(--dt-font-heading-xl-italic-size--wide) * 1px);line-height:calc(var(--dt-font-heading-xl-italic-line-height--wide) * 1px)}}.c-skeleton-line--font-heading-xxl-italic{font-family:var(--dt-font-heading-xxl-italic-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-heading-xxl-italic-weight);font-style:var(--dt-font-heading-xxl-italic-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-heading-xxl-italic-size--narrow) * 1px);line-height:calc(var(--dt-font-heading-xxl-italic-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-heading-xxl-italic{font-size:calc(var(--dt-font-heading-xxl-italic-size--wide) * 1px);line-height:calc(var(--dt-font-heading-xxl-italic-line-height--wide) * 1px)}}.c-skeleton-line--font-subheading-s{font-family:var(--dt-font-subheading-s-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-subheading-s-weight);font-size:calc(var(--dt-font-subheading-s-size--narrow) * 1px);line-height:calc(var(--dt-font-subheading-s-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-subheading-s{font-size:calc(var(--dt-font-subheading-s-size--wide) * 1px);line-height:calc(var(--dt-font-subheading-s-line-height--wide) * 1px)}}.c-skeleton-line--font-subheading-l{font-family:var(--dt-font-subheading-l-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-subheading-l-weight);font-size:calc(var(--dt-font-subheading-l-size--narrow) * 1px);line-height:calc(var(--dt-font-subheading-l-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-subheading-l{font-size:calc(var(--dt-font-subheading-l-size--wide) * 1px);line-height:calc(var(--dt-font-subheading-l-line-height--wide) * 1px)}}.c-skeleton-line--font-interactive-xs{font-family:var(--dt-font-interactive-xs-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-interactive-xs-weight);font-size:calc(var(--dt-font-interactive-xs-size) * 1px);line-height:calc(var(--dt-font-interactive-xs-line-height) * 1px)}.c-skeleton-line--font-interactive-s{font-family:var(--dt-font-interactive-s-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-interactive-s-weight);font-size:calc(var(--dt-font-interactive-s-size) * 1px);line-height:calc(var(--dt-font-interactive-s-line-height) * 1px)}.c-skeleton-line--font-interactive-l{font-family:var(--dt-font-interactive-l-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-interactive-l-weight);font-size:calc(var(--dt-font-interactive-l-size) * 1px);line-height:calc(var(--dt-font-interactive-l-line-height) * 1px)}.c-skeleton-line--font-body-s{font-family:var(--dt-font-body-s-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-s-weight);font-size:calc(var(--dt-font-body-s-size) * 1px);line-height:calc(var(--dt-font-body-s-line-height) * 1px)}.c-skeleton-line--font-body-s-link{font-family:var(--dt-font-body-s-link-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-s-link-weight);text-decoration:var(--dt-font-body-s-link-text-decoration);font-size:calc(var(--dt-font-body-s-link-size) * 1px);line-height:calc(var(--dt-font-body-s-link-line-height) * 1px)}.c-skeleton-line--font-body-l{font-family:var(--dt-font-body-l-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-l-weight);font-size:calc(var(--dt-font-body-l-size) * 1px);line-height:calc(var(--dt-font-body-l-line-height) * 1px)}.c-skeleton-line--font-body-l-link{font-family:var(--dt-font-body-l-link-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-l-link-weight);text-decoration:var(--dt-font-body-l-link-text-decoration);font-size:calc(var(--dt-font-body-l-link-size) * 1px);line-height:calc(var(--dt-font-body-l-link-line-height) * 1px)}.c-skeleton-line--font-body-strong-s{font-family:var(--dt-font-body-strong-s-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-strong-s-weight);font-size:calc(var(--dt-font-body-strong-s-size) * 1px);line-height:calc(var(--dt-font-body-strong-s-line-height) * 1px)}.c-skeleton-line--font-body-strong-s-link{font-family:var(--dt-font-body-strong-s-link-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-strong-s-link-weight);text-decoration:var(--dt-font-body-strong-s-link-text-decoration);font-size:calc(var(--dt-font-body-strong-s-link-size) * 1px);line-height:calc(var(--dt-font-body-strong-s-link-line-height) * 1px)}.c-skeleton-line--font-body-strong-l{font-family:var(--dt-font-body-strong-l-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-strong-l-weight);font-size:calc(var(--dt-font-body-strong-l-size) * 1px);line-height:calc(var(--dt-font-body-strong-l-line-height) * 1px)}.c-skeleton-line--font-body-strong-l-link{font-family:var(--dt-font-body-strong-l-link-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-body-strong-l-link-weight);text-decoration:var(--dt-font-body-strong-l-link-text-decoration);font-size:calc(var(--dt-font-body-strong-l-link-size) * 1px);line-height:calc(var(--dt-font-body-strong-l-link-line-height) * 1px)}.c-skeleton-line--font-caption{font-family:var(--dt-font-caption-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-caption-weight);font-size:calc(var(--dt-font-caption-size) * 1px);line-height:calc(var(--dt-font-caption-line-height) * 1px)}.c-skeleton-line--font-caption-link{font-family:var(--dt-font-caption-link-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-caption-link-weight);text-decoration:var(--dt-font-caption-link-text-decoration);font-size:calc(var(--dt-font-caption-link-size) * 1px);line-height:calc(var(--dt-font-caption-link-line-height) * 1px)}.c-skeleton-line--font-caption-strong{font-family:var(--dt-font-caption-strong-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-caption-strong-weight);font-size:calc(var(--dt-font-caption-strong-size) * 1px);line-height:calc(var(--dt-font-caption-strong-line-height) * 1px)}.c-skeleton-line--font-caption-strong-italic{font-family:var(--dt-font-caption-strong-italic-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-caption-strong-italic-weight);font-style:var(--dt-font-caption-strong-italic-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-caption-strong-italic-size) * 1px);line-height:calc(var(--dt-font-caption-strong-italic-line-height) * 1px)}.c-skeleton-line--font-caption-strong-link{font-family:var(--dt-font-caption-strong-link-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-caption-strong-link-weight);text-decoration:var(--dt-font-caption-strong-link-text-decoration);font-size:calc(var(--dt-font-caption-strong-link-size) * 1px);line-height:calc(var(--dt-font-caption-strong-link-line-height) * 1px)}.c-skeleton-line--font-display-xl{font-family:var(--dt-font-display-xl-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-display-xl-weight);font-style:var(--dt-font-display-xl-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-display-xl-size--narrow) * 1px);line-height:calc(var(--dt-font-display-xl-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-display-xl{font-size:calc(var(--dt-font-display-xl-size--wide) * 1px);line-height:calc(var(--dt-font-display-xl-line-height--wide) * 1px)}}.c-skeleton-line--font-display-l{font-family:var(--dt-font-display-l-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-display-l-weight);font-style:var(--dt-font-display-l-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-display-l-size--narrow) * 1px);line-height:calc(var(--dt-font-display-l-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-display-l{font-size:calc(var(--dt-font-display-l-size--wide) * 1px);line-height:calc(var(--dt-font-display-l-line-height--wide) * 1px)}}.c-skeleton-line--font-display-m{font-family:var(--dt-font-display-m-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-display-m-weight);font-style:var(--dt-font-display-m-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-display-m-size--narrow) * 1px);line-height:calc(var(--dt-font-display-m-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-display-m{font-size:calc(var(--dt-font-display-m-size--wide) * 1px);line-height:calc(var(--dt-font-display-m-line-height--wide) * 1px)}}.c-skeleton-line--font-display-s{font-family:var(--dt-font-display-s-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-display-s-weight);font-style:var(--dt-font-display-s-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-display-s-size--narrow) * 1px);line-height:calc(var(--dt-font-display-s-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-display-s{font-size:calc(var(--dt-font-display-s-size--wide) * 1px);line-height:calc(var(--dt-font-display-s-line-height--wide) * 1px)}}.c-skeleton-line--font-display-xs{font-family:var(--dt-font-display-xs-family),var(--dt-font-family-secondary),sans-serif;font-weight:var(--dt-font-display-xs-weight);font-style:var(--dt-font-display-xs-font-style);font-variation-settings:"slnt" -20;font-size:calc(var(--dt-font-display-xs-size--narrow) * 1px);line-height:calc(var(--dt-font-display-xs-line-height--narrow) * 1px)}@media(min-width:768px){.c-skeleton-line--font-display-xs{font-size:calc(var(--dt-font-display-xs-size--wide) * 1px);line-height:calc(var(--dt-font-display-xs-line-height--wide) * 1px)}}.c-skeleton--star{display:flex;gap:0;width:fit-content}.c-skeleton-star{flex:0 0 auto;inline-size:var(--skeleton-star-size);block-size:var(--skeleton-star-size);-webkit-mask-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Cpath%20d='m12.288%2014.449-4.183-2.197a.22.22%200%200%200-.21%200L3.713%2014.45%204.5%209.794a.25.25%200%200%200%200-.193L1.07%206.302l4.673-.682a.23.23%200%200%200%20.166-.114L8%201.271l2.091%204.235a.23.23%200%200%200%20.167.114l4.672.682-3.386%203.3a.25.25%200%200%200-.061.192z'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2016%2016'%3E%3Cpath%20d='m12.288%2014.449-4.183-2.197a.22.22%200%200%200-.21%200L3.713%2014.45%204.5%209.794a.25.25%200%200%200%200-.193L1.07%206.302l4.673-.682a.23.23%200%200%200%20.166-.114L8%201.271l2.091%204.235a.23.23%200%200%200%20.167.114l4.672.682-3.386%203.3a.25.25%200%200%200-.061.192z'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain}@media(prefers-reduced-motion:reduce){.c-skeleton--box,.c-skeleton--circle,.c-skeleton--pill,.c-skeleton-star,.c-skeleton-line:after{background-image:none;animation:none}}`, z = ["box", "circle", "pill", "text", "star"], w = ["default", "strong", "subtle"], _ = {
|
|
13
13
|
default: "c-skeleton--backgroundDefault",
|
|
14
14
|
strong: "c-skeleton--backgroundStrong",
|
|
15
15
|
subtle: "c-skeleton--backgroundSubtle"
|
|
@@ -55,8 +55,8 @@ var M = Object.defineProperty, I = Object.getOwnPropertyDescriptor, r = (t, n, i
|
|
|
55
55
|
(s = t[c]) && (o = (e ? s(n, i, o) : s(o)) || o);
|
|
56
56
|
return e && o && M(n, i, o), o;
|
|
57
57
|
};
|
|
58
|
-
const
|
|
59
|
-
let a = class extends
|
|
58
|
+
const g = "pie-skeleton", B = /^\d*\.?\d+(px|rem|em|%|vh|vw)$/;
|
|
59
|
+
let a = class extends v {
|
|
60
60
|
constructor() {
|
|
61
61
|
super(...arguments), this.variant = l.variant, this.backgroundColor = l.backgroundColor, this.lines = l.lines, this.stars = l.stars, this.borderRadius = l.borderRadius, this.aspectRatio = l.aspectRatio, this.isResponsive = l.isResponsive;
|
|
62
62
|
}
|
|
@@ -166,12 +166,12 @@ let a = class extends p {
|
|
|
166
166
|
_renderTextLines() {
|
|
167
167
|
const t = this._linesCount, { height: n } = this;
|
|
168
168
|
return Array.from({ length: t }, (i, e) => {
|
|
169
|
-
const o = t > 1 && e === t - 1, c =
|
|
169
|
+
const o = t > 1 && e === t - 1, c = m({
|
|
170
170
|
"c-skeleton-line": !0,
|
|
171
171
|
"is-last": o,
|
|
172
172
|
[`c-skeleton-line--${n}`]: !!n
|
|
173
173
|
});
|
|
174
|
-
return
|
|
174
|
+
return p`<div class="${c}"></div>`;
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
177
|
/**
|
|
@@ -180,7 +180,7 @@ let a = class extends p {
|
|
|
180
180
|
* @private
|
|
181
181
|
*/
|
|
182
182
|
_renderStars() {
|
|
183
|
-
return Array.from({ length: this._starsCount }, () =>
|
|
183
|
+
return Array.from({ length: this._starsCount }, () => p`<div class="c-skeleton-star"></div>`);
|
|
184
184
|
}
|
|
185
185
|
/**
|
|
186
186
|
* Renders the shapes drawn inside the root element. The box, circle and pill variants
|
|
@@ -192,24 +192,24 @@ let a = class extends p {
|
|
|
192
192
|
return this.variant === "text" ? this._renderTextLines() : this.variant === "star" ? this._renderStars() : u;
|
|
193
193
|
}
|
|
194
194
|
render() {
|
|
195
|
-
return
|
|
195
|
+
return p`
|
|
196
196
|
<div
|
|
197
197
|
data-test-id="pie-skeleton"
|
|
198
|
-
class="${
|
|
198
|
+
class="${m(this._rootClasses)}"
|
|
199
199
|
style="${this._rootStyles}">
|
|
200
200
|
${this._renderShapes()}
|
|
201
201
|
</div>
|
|
202
202
|
`;
|
|
203
203
|
}
|
|
204
204
|
};
|
|
205
|
-
a.styles =
|
|
205
|
+
a.styles = b(y);
|
|
206
206
|
r([
|
|
207
207
|
d({ type: String }),
|
|
208
|
-
g
|
|
208
|
+
h(g, z, l.variant)
|
|
209
209
|
], a.prototype, "variant", 2);
|
|
210
210
|
r([
|
|
211
211
|
d({ type: String }),
|
|
212
|
-
g
|
|
212
|
+
h(g, w, l.backgroundColor)
|
|
213
213
|
], a.prototype, "backgroundColor", 2);
|
|
214
214
|
r([
|
|
215
215
|
d({ type: String })
|
|
@@ -225,11 +225,11 @@ r([
|
|
|
225
225
|
], a.prototype, "stars", 2);
|
|
226
226
|
r([
|
|
227
227
|
d({ type: String }),
|
|
228
|
-
g
|
|
228
|
+
h(g, C, l.borderRadius)
|
|
229
229
|
], a.prototype, "borderRadius", 2);
|
|
230
230
|
r([
|
|
231
231
|
d({ type: String }),
|
|
232
|
-
g
|
|
232
|
+
h(g, S, l.aspectRatio)
|
|
233
233
|
], a.prototype, "aspectRatio", 2);
|
|
234
234
|
r([
|
|
235
235
|
d({ type: Boolean })
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justeattakeaway/pie-skeleton",
|
|
3
3
|
"description": "PIE Design System Skeleton built using Web Components",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.js",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"license": "Apache-2.0",
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@justeattakeaway/pie-components-config": "0.21.5",
|
|
39
|
-
"@justeattakeaway/pie-css": "1.9.
|
|
40
|
-
"@justeattakeaway/pie-monorepo-utils": "0.9.
|
|
39
|
+
"@justeattakeaway/pie-css": "1.9.3",
|
|
40
|
+
"@justeattakeaway/pie-monorepo-utils": "0.9.14"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@justeattakeaway/pie-webc-core": "22.0.1"
|
package/src/skeleton.scss
CHANGED
|
@@ -23,6 +23,45 @@ $font-identifiers: ();
|
|
|
23
23
|
// The pie-button sizes a pill can match, via height="button-{size}".
|
|
24
24
|
$button-sizes: ('xsmall', 'small-productive', 'small-expressive', 'medium', 'large');
|
|
25
25
|
|
|
26
|
+
// The shimmer shared by every shape (box, circle, pill, text bar and star). A soft diagonal
|
|
27
|
+
// band of the matching shimmer token (at 50% opacity) sweeps from left to right. The band is
|
|
28
|
+
// anchored to the viewport (background-attachment: fixed), so every skeleton on the page
|
|
29
|
+
// shares one continuous wave and shapes light up as the wave passes over them, rather than
|
|
30
|
+
// each shape animating its own band. The band starts off the leading edge, so a shape that is
|
|
31
|
+
// not animating (reduced motion, or a frozen visual test) shows only the flat background colour.
|
|
32
|
+
@mixin skeleton-shimmer {
|
|
33
|
+
background-attachment: fixed;
|
|
34
|
+
background-color: var(--skeleton-bg);
|
|
35
|
+
background-image: linear-gradient(
|
|
36
|
+
135deg,
|
|
37
|
+
transparent 40%,
|
|
38
|
+
var(--skeleton-shimmer-color) 50%,
|
|
39
|
+
transparent 60%
|
|
40
|
+
);
|
|
41
|
+
background-position: 150% 0;
|
|
42
|
+
background-repeat: no-repeat;
|
|
43
|
+
background-size: 200% 100%;
|
|
44
|
+
|
|
45
|
+
animation: skeletonShimmer var(--skeleton-shimmer-duration) linear infinite;
|
|
46
|
+
animation-direction: var(--skeleton-shimmer-direction);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@keyframes skeletonShimmer {
|
|
50
|
+
0% {
|
|
51
|
+
background-position: 150% 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// The band finishes its sweep after 1000ms (83.333% of the 1200ms cycle), then rests for the
|
|
55
|
+
// remaining 200ms before the next sweep.
|
|
56
|
+
83.333% {
|
|
57
|
+
background-position: -50% 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
100% {
|
|
61
|
+
background-position: -50% 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
26
65
|
:host {
|
|
27
66
|
display: block;
|
|
28
67
|
|
|
@@ -35,23 +74,40 @@ $button-sizes: ('xsmall', 'small-productive', 'small-expressive', 'medium', 'lar
|
|
|
35
74
|
--skeleton-border-radius: var(--dt-radius-rounded-b);
|
|
36
75
|
--skeleton-text-radius: var(--dt-radius-rounded-a);
|
|
37
76
|
--skeleton-star-size: var(--dt-spacing-e);
|
|
77
|
+
--skeleton-shimmer: var(--dt-color-skeleton-shimmer-01);
|
|
78
|
+
--skeleton-shimmer-color: color-mix(in srgb, var(--skeleton-shimmer) 50%, transparent);
|
|
79
|
+
|
|
80
|
+
// The Figma spec calls for a 1200ms cycle: the band sweeps for 1000ms, then rests for 200ms
|
|
81
|
+
// before looping. pie-design-tokens has no skeleton duration token (the motion-timing tokens
|
|
82
|
+
// top out at 350ms), so this is defined locally and flagged to design to add one.
|
|
83
|
+
--skeleton-shimmer-duration: 1200ms;
|
|
84
|
+
|
|
85
|
+
// Reversed in RTL so the shimmer follows the reading direction (right to left).
|
|
86
|
+
--skeleton-shimmer-direction: normal;
|
|
38
87
|
|
|
39
88
|
position: relative;
|
|
40
89
|
overflow: hidden;
|
|
41
90
|
width: 100%;
|
|
42
91
|
}
|
|
43
92
|
|
|
93
|
+
:host(:dir(rtl)) .c-skeleton {
|
|
94
|
+
--skeleton-shimmer-direction: reverse;
|
|
95
|
+
}
|
|
96
|
+
|
|
44
97
|
// Background colours
|
|
45
98
|
.c-skeleton--backgroundDefault {
|
|
46
99
|
--skeleton-bg: var(--dt-color-skeleton-01);
|
|
100
|
+
--skeleton-shimmer: var(--dt-color-skeleton-shimmer-01);
|
|
47
101
|
}
|
|
48
102
|
|
|
49
103
|
.c-skeleton--backgroundStrong {
|
|
50
104
|
--skeleton-bg: var(--dt-color-skeleton-02);
|
|
105
|
+
--skeleton-shimmer: var(--dt-color-skeleton-shimmer-02);
|
|
51
106
|
}
|
|
52
107
|
|
|
53
108
|
.c-skeleton--backgroundSubtle {
|
|
54
109
|
--skeleton-bg: var(--dt-color-skeleton-03);
|
|
110
|
+
--skeleton-shimmer: var(--dt-color-skeleton-shimmer-03);
|
|
55
111
|
}
|
|
56
112
|
|
|
57
113
|
// Shapes
|
|
@@ -59,7 +115,7 @@ $button-sizes: ('xsmall', 'small-productive', 'small-expressive', 'medium', 'lar
|
|
|
59
115
|
.c-skeleton--circle,
|
|
60
116
|
.c-skeleton--pill,
|
|
61
117
|
.c-skeleton-star {
|
|
62
|
-
|
|
118
|
+
@include skeleton-shimmer;
|
|
63
119
|
}
|
|
64
120
|
|
|
65
121
|
// Box
|
|
@@ -160,16 +216,14 @@ $button-sizes: ('xsmall', 'small-productive', 'small-expressive', 'medium', 'lar
|
|
|
160
216
|
content: '\200b';
|
|
161
217
|
}
|
|
162
218
|
|
|
163
|
-
// The bar is the font size tall and centred in the line box.
|
|
164
219
|
&:after {
|
|
220
|
+
@include skeleton-shimmer;
|
|
165
221
|
content: '';
|
|
166
222
|
position: absolute;
|
|
167
223
|
inset-inline: 0;
|
|
168
|
-
inset-block-start: 50
|
|
169
|
-
translate: 0 -50%;
|
|
224
|
+
inset-block-start: calc(50% - 0.5em);
|
|
170
225
|
block-size: 1em;
|
|
171
226
|
border-radius: var(--skeleton-text-radius);
|
|
172
|
-
background-color: var(--skeleton-bg);
|
|
173
227
|
}
|
|
174
228
|
|
|
175
229
|
// With more than one line, the last line is half width (set through the is-last class).
|
|
@@ -202,3 +256,16 @@ $button-sizes: ('xsmall', 'small-productive', 'small-expressive', 'medium', 'lar
|
|
|
202
256
|
mask-repeat: no-repeat;
|
|
203
257
|
mask-size: contain;
|
|
204
258
|
}
|
|
259
|
+
|
|
260
|
+
// Motion-sensitive users get a static placeholder: no shimmer, just the background colour.
|
|
261
|
+
@media (prefers-reduced-motion: reduce) {
|
|
262
|
+
.c-skeleton--box,
|
|
263
|
+
.c-skeleton--circle,
|
|
264
|
+
.c-skeleton--pill,
|
|
265
|
+
.c-skeleton-star,
|
|
266
|
+
.c-skeleton-line:after {
|
|
267
|
+
background-image: none;
|
|
268
|
+
|
|
269
|
+
animation: none;
|
|
270
|
+
}
|
|
271
|
+
}
|