@justeattakeaway/pie-skeleton 0.0.1 → 0.1.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/dist/react.js CHANGED
@@ -1,13 +1,26 @@
1
1
  import * as e from "react";
2
- import { createComponent as t } from "@lit/react";
3
- import { PieSkeleton as o } from "./index.js";
4
- const n = t({
2
+ import { createComponent as o } from "@lit/react";
3
+ import { PieSkeleton as t } from "./index.js";
4
+ import { LINES_MAX as m, LINES_MIN as S, STARS_MAX as p, STARS_MIN as c, aspectRatios as k, backgroundColorClassNames as d, backgroundColors as N, borderRadii as f, buttonSizes as P, defaultProps as R, spacingIdentifiers as C, variants as I } from "./index.js";
5
+ const a = o({
5
6
  displayName: "PieSkeleton",
6
- elementClass: o,
7
+ elementClass: t,
7
8
  react: e,
8
9
  tagName: "pie-skeleton",
9
10
  events: {}
10
- }), m = n;
11
+ }), i = a;
11
12
  export {
12
- m as PieSkeleton
13
+ m as LINES_MAX,
14
+ S as LINES_MIN,
15
+ i as PieSkeleton,
16
+ p as STARS_MAX,
17
+ c as STARS_MIN,
18
+ k as aspectRatios,
19
+ d as backgroundColorClassNames,
20
+ N as backgroundColors,
21
+ f as borderRadii,
22
+ P as buttonSizes,
23
+ R as defaultProps,
24
+ C as spacingIdentifiers,
25
+ I as variants
13
26
  };
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.0.1",
4
+ "version": "0.1.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -36,7 +36,7 @@
36
36
  "license": "Apache-2.0",
37
37
  "devDependencies": {
38
38
  "@justeattakeaway/pie-components-config": "0.21.5",
39
- "@justeattakeaway/pie-css": "1.9.1",
39
+ "@justeattakeaway/pie-css": "1.9.2",
40
40
  "@justeattakeaway/pie-monorepo-utils": "0.9.13"
41
41
  },
42
42
  "dependencies": {
package/src/defs.ts CHANGED
@@ -1,3 +1,125 @@
1
- // TODO - please remove the eslint disable comment below when you add props to this interface
2
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
3
- export interface SkeletonProps {}
1
+ import { type ComponentDefaultProps } from '@justeattakeaway/pie-webc-core';
2
+
3
+ export const variants = ['box', 'circle', 'pill', 'text', 'star'] as const;
4
+
5
+ export const backgroundColors = ['default', 'strong', 'subtle'] as const;
6
+
7
+ export const backgroundColorClassNames: Record<typeof backgroundColors[number], string> = {
8
+ default: 'c-skeleton--backgroundDefault',
9
+ strong: 'c-skeleton--backgroundStrong',
10
+ subtle: 'c-skeleton--backgroundSubtle',
11
+ };
12
+
13
+ export const aspectRatios = ['1by1', '4by3', '16by9', '3by4', '9by16'] as const;
14
+
15
+ export const borderRadii = [
16
+ 'radius-rounded-none',
17
+ 'radius-rounded-a',
18
+ 'radius-rounded-b',
19
+ 'radius-rounded-c',
20
+ 'radius-rounded-d',
21
+ 'radius-rounded-e',
22
+ 'radius-rounded-f',
23
+ 'radius-rounded-g',
24
+ ] as const;
25
+
26
+ /**
27
+ * The `pie-button` size names accepted by the `pill` variant's `height`.
28
+ */
29
+ export const buttonSizes = [
30
+ 'button-xsmall',
31
+ 'button-small-productive',
32
+ 'button-small-expressive',
33
+ 'button-medium',
34
+ 'button-large',
35
+ ] as const;
36
+
37
+ /**
38
+ * The lettered spacing tokens accepted as a `height`, written as the token name without the
39
+ * `--dt-` prefix (e.g. `spacing-e`). The numbered base tokens (`--dt-spacing-24`, etc.) are not supported.
40
+ */
41
+ export const spacingIdentifiers = [
42
+ 'spacing-none',
43
+ 'spacing-a-small',
44
+ 'spacing-a',
45
+ 'spacing-b',
46
+ 'spacing-c',
47
+ 'spacing-d',
48
+ 'spacing-e',
49
+ 'spacing-f',
50
+ 'spacing-g',
51
+ 'spacing-h',
52
+ 'spacing-i',
53
+ 'spacing-j',
54
+ ] as const;
55
+
56
+ /** The minimum number of lines the `text` variant can draw. */
57
+ export const LINES_MIN = 1;
58
+ /** The maximum number of lines the `text` variant can draw. */
59
+ export const LINES_MAX = 10;
60
+ /** The minimum number of stars the `star` variant can draw. */
61
+ export const STARS_MIN = 1;
62
+ /** The maximum number of stars the `star` variant can draw. */
63
+ export const STARS_MAX = 10;
64
+
65
+ export interface SkeletonProps {
66
+ /**
67
+ * The shape the skeleton draws: a box, a circle, a pill, a block of text lines or a row of stars.
68
+ */
69
+ variant?: typeof variants[number];
70
+
71
+ /**
72
+ * The background colour. `strong` is darker (for nested levels) and `subtle` is lighter (for nested levels or darker surfaces).
73
+ */
74
+ backgroundColor?: typeof backgroundColors[number];
75
+
76
+ /**
77
+ * The width of the skeleton. Accepts an absolute value (e.g. `120px`) or a percentage of the container (e.g. `50%`).
78
+ * Ignored by the `circle` and `star` variants.
79
+ */
80
+ width?: string;
81
+
82
+ /**
83
+ * The height of the skeleton. The accepted formats depend on the variant. See the component documentation for the full list.
84
+ */
85
+ height?: string;
86
+
87
+ /**
88
+ * The number of text lines to draw. Applies to the `text` variant only. Values are clamped between 1 and 10.
89
+ */
90
+ lines?: number;
91
+
92
+ /**
93
+ * The number of stars to draw. Applies to the `star` variant only. Values are clamped between 1 and 10.
94
+ */
95
+ stars?: number;
96
+
97
+ /**
98
+ * The corner radius of the `box` variant, as a radius token identifier (e.g. `radius-rounded-b`).
99
+ * Ignored by the `text`, `pill`, `circle` and `star` variants.
100
+ */
101
+ borderRadius?: typeof borderRadii[number];
102
+
103
+ /**
104
+ * The aspect ratio of the `box` variant. Ignored when both `width` and `height` are set.
105
+ */
106
+ aspectRatio?: typeof aspectRatios[number];
107
+
108
+ /**
109
+ * When true, a `pill` with a `button-*` height switches to the wide button height above the `md` breakpoint,
110
+ * matching `pie-button`. Ignored otherwise.
111
+ */
112
+ isResponsive?: boolean;
113
+ }
114
+
115
+ export type DefaultProps = ComponentDefaultProps<SkeletonProps, keyof Omit<SkeletonProps, 'width' | 'height'>>;
116
+
117
+ export const defaultProps: DefaultProps = {
118
+ variant: 'box',
119
+ backgroundColor: 'default',
120
+ lines: 1,
121
+ stars: 1,
122
+ borderRadius: 'radius-rounded-b',
123
+ aspectRatio: '1by1',
124
+ isResponsive: false,
125
+ };
package/src/index.ts CHANGED
@@ -1,24 +1,263 @@
1
-
2
- import { html, unsafeCSS } from 'lit';
3
- import { PieElement } from '@justeattakeaway/pie-webc-core/src/internals/PieElement';
4
1
  import {
5
- safeCustomElement,
6
- } from '@justeattakeaway/pie-webc-core';
2
+ html, nothing, unsafeCSS,
3
+ } from 'lit';
4
+ import { PieElement } from '@justeattakeaway/pie-webc-core/src/internals/PieElement';
5
+ import { safeCustomElement, validPropertyValues } from '@justeattakeaway/pie-webc-core';
6
+ import { classMap } from 'lit/directives/class-map.js';
7
+ import { property } from 'lit/decorators.js';
7
8
  import styles from './skeleton.scss?inline';
8
- import { type SkeletonProps } from './defs';
9
+ import {
10
+ type SkeletonProps,
11
+ defaultProps,
12
+ variants,
13
+ backgroundColors,
14
+ backgroundColorClassNames,
15
+ aspectRatios,
16
+ borderRadii,
17
+ buttonSizes,
18
+ spacingIdentifiers,
19
+ LINES_MIN,
20
+ LINES_MAX,
21
+ STARS_MIN,
22
+ STARS_MAX,
23
+ } from './defs';
9
24
 
10
25
  // Valid values available to consumers
11
26
  export * from './defs';
12
27
 
13
28
  const componentSelector = 'pie-skeleton';
14
29
 
30
+ // Matches absolute (e.g. `40px`) and percentage (e.g. `50%`) height values.
31
+ const LENGTH_REGEX = /^\d*\.?\d+(px|rem|em|%|vh|vw)$/;
32
+
15
33
  /**
16
34
  * @tagname pie-skeleton
17
35
  */
18
36
  @safeCustomElement('pie-skeleton')
19
37
  export class PieSkeleton extends PieElement implements SkeletonProps {
38
+ @property({ type: String })
39
+ @validPropertyValues(componentSelector, variants, defaultProps.variant)
40
+ public variant = defaultProps.variant;
41
+
42
+ @property({ type: String })
43
+ @validPropertyValues(componentSelector, backgroundColors, defaultProps.backgroundColor)
44
+ public backgroundColor = defaultProps.backgroundColor;
45
+
46
+ @property({ type: String })
47
+ public width: SkeletonProps['width'];
48
+
49
+ @property({ type: String })
50
+ public height: SkeletonProps['height'];
51
+
52
+ @property({ type: Number })
53
+ public lines = defaultProps.lines;
54
+
55
+ @property({ type: Number })
56
+ public stars = defaultProps.stars;
57
+
58
+ @property({ type: String })
59
+ @validPropertyValues(componentSelector, borderRadii, defaultProps.borderRadius)
60
+ public borderRadius = defaultProps.borderRadius;
61
+
62
+ @property({ type: String })
63
+ @validPropertyValues(componentSelector, aspectRatios, defaultProps.aspectRatio)
64
+ public aspectRatio = defaultProps.aspectRatio;
65
+
66
+ @property({ type: Boolean })
67
+ public isResponsive = defaultProps.isResponsive;
68
+
69
+ /**
70
+ * Clamps a numeric prop to the given inclusive range. Non-numeric values fall back to the minimum.
71
+ *
72
+ * @private
73
+ */
74
+ private _clamp (value: number, min: number, max: number): number {
75
+ const parsed = Math.trunc(Number(value));
76
+ if (!Number.isFinite(parsed)) return min;
77
+ return Math.min(Math.max(parsed, min), max);
78
+ }
79
+
80
+ /**
81
+ * The number of text lines to draw, clamped between 1 and 10.
82
+ *
83
+ * @private
84
+ */
85
+ private get _linesCount (): number {
86
+ return this._clamp(this.lines, LINES_MIN, LINES_MAX);
87
+ }
88
+
89
+ /**
90
+ * The number of stars to draw, clamped between 1 and 10.
91
+ *
92
+ * @private
93
+ */
94
+ private get _starsCount (): number {
95
+ return this._clamp(this.stars, STARS_MIN, STARS_MAX);
96
+ }
97
+
98
+ /**
99
+ * Whether a `height` value is a `pie-button` size name.
100
+ *
101
+ * @private
102
+ */
103
+ private _isButtonSize (value?: string): value is typeof buttonSizes[number] {
104
+ return !!value && (buttonSizes as readonly string[]).includes(value);
105
+ }
106
+
107
+ /**
108
+ * Whether a `height` value is a supported spacing identifier (e.g. `spacing-e`).
109
+ *
110
+ * @private
111
+ */
112
+ private _isSpacingIdentifier (value?: string): boolean {
113
+ return !!value && (spacingIdentifiers as readonly string[]).includes(value);
114
+ }
115
+
116
+ /**
117
+ * Resolves the `height` prop to a CSS length for the variants that accept absolute values,
118
+ * percentages or spacing identifiers (box, circle, pill and star).
119
+ * Returns `undefined` when the value is handled elsewhere (a `button-*` size) or isn't valid
120
+ * for the variant, so the CSS default applies.
121
+ *
122
+ * @private
123
+ */
124
+ private _resolveHeight (): string | undefined {
125
+ const { height, variant } = this;
126
+
127
+ if (!height) return undefined;
128
+
129
+ if (this._isSpacingIdentifier(height)) return `var(--dt-${height})`;
130
+
131
+ // For pill variants, the height is defined by a class
132
+ if (variant === 'pill' && this._isButtonSize(height)) return undefined;
133
+
134
+ // The star variant ignores percentages: a row of fixed-shape stars has no percentage height.
135
+ if (variant === 'star' && height.endsWith('%')) return undefined;
136
+
137
+ return LENGTH_REGEX.test(height) ? height : undefined;
138
+ }
139
+
140
+ /**
141
+ * The classes applied to the root element.
142
+ *
143
+ * @private
144
+ */
145
+ private get _rootClasses (): Record<string, boolean> {
146
+ const {
147
+ variant, backgroundColor, borderRadius, aspectRatio, isResponsive, height,
148
+ } = this;
149
+
150
+ const classes: Record<string, boolean> = {
151
+ 'c-skeleton': true,
152
+ [`c-skeleton--${variant}`]: true,
153
+ [backgroundColorClassNames[backgroundColor]]: true,
154
+ };
155
+
156
+ if (variant === 'box') {
157
+ classes[`c-skeleton--${borderRadius}`] = true;
158
+ classes[`c-skeleton--${aspectRatio}`] = true;
159
+ }
160
+
161
+ if (variant === 'pill') {
162
+ if (this._isButtonSize(height)) {
163
+ classes[`c-skeleton--${height}`] = true;
164
+ } else if (!this._resolveHeight()) {
165
+ // The pill defaults to the medium button height.
166
+ classes['c-skeleton--button-medium'] = true;
167
+ }
168
+ classes['c-skeleton--responsive'] = isResponsive;
169
+ }
170
+
171
+ return classes;
172
+ }
173
+
174
+ /**
175
+ * The inline styles applied to the root element.
176
+ *
177
+ * @private
178
+ */
179
+ private get _rootStyles (): string {
180
+ const { variant, width } = this;
181
+ const styles: string[] = [];
182
+
183
+ // `width` is ignored by the circle and star variants.
184
+ if (width && variant !== 'circle' && variant !== 'star') {
185
+ styles.push(`width: ${width}`);
186
+ }
187
+
188
+ if (variant === 'circle') {
189
+ // A circle is sized by its height; width follows so it stays 1:1.
190
+ const height = this._resolveHeight();
191
+ if (height) {
192
+ styles.push(`width: ${height}`, `height: ${height}`);
193
+ }
194
+ } else if (variant === 'box' || variant === 'pill') {
195
+ const height = this._resolveHeight();
196
+ if (height) styles.push(`height: ${height}`);
197
+ }
198
+
199
+ // The star variant sizes each star from a single custom property.
200
+ if (variant === 'star') {
201
+ const size = this._resolveHeight();
202
+ if (size) styles.push(`--skeleton-star-size: ${size}`);
203
+ }
204
+
205
+ return styles.join('; ');
206
+ }
207
+
208
+ /**
209
+ * Renders the text lines for the `text` variant. When there's more than one line,
210
+ * the last line is drawn at half width (handled in CSS through the `is-last` class).
211
+ *
212
+ * @private
213
+ */
214
+ private _renderTextLines () {
215
+ const lineCount = this._linesCount;
216
+ const { height } = this;
217
+
218
+ return Array.from({ length: lineCount }, (_, index) => {
219
+ const isLastLine = lineCount > 1 && index === lineCount - 1;
220
+
221
+ const lineClasses = classMap({
222
+ 'c-skeleton-line': true,
223
+ 'is-last': isLastLine,
224
+ [`c-skeleton-line--${height}`]: !!height,
225
+ });
226
+
227
+ return html`<div class="${lineClasses}"></div>`;
228
+ });
229
+ }
230
+
231
+ /**
232
+ * Renders the stars for the `star` variant.
233
+ *
234
+ * @private
235
+ */
236
+ private _renderStars () {
237
+ return Array.from({ length: this._starsCount }, () => html`<div class="c-skeleton-star"></div>`);
238
+ }
239
+
240
+ /**
241
+ * Renders the shapes drawn inside the root element. The box, circle and pill variants
242
+ * are drawn by the root element itself, so they have no children.
243
+ *
244
+ * @private
245
+ */
246
+ private _renderShapes () {
247
+ if (this.variant === 'text') return this._renderTextLines();
248
+ if (this.variant === 'star') return this._renderStars();
249
+ return nothing;
250
+ }
251
+
20
252
  render () {
21
- return html`<h1 data-test-id="pie-skeleton">Hello world!</h1>`;
253
+ return html`
254
+ <div
255
+ data-test-id="pie-skeleton"
256
+ class="${classMap(this._rootClasses)}"
257
+ style="${this._rootStyles}">
258
+ ${this._renderShapes()}
259
+ </div>
260
+ `;
22
261
  }
23
262
 
24
263
  // Renders a `CSSResult` generated from SCSS by Vite
package/src/skeleton.scss CHANGED
@@ -1,7 +1,204 @@
1
+ @use 'sass:meta';
2
+ @use 'sass:string';
3
+ @use 'sass:list';
4
+ @use '@justeat/pie-design-tokens/dist/jet.scss' as tokens;
1
5
  @use '@justeattakeaway/pie-css/scss' as p;
6
+ @use '@justeattakeaway/pie-css/scss/mixins/components/button' as btn;
7
+
8
+ // Build the list of typography identifiers from the design tokens at build time.
9
+ // Every font-* token ending in -size or -size--narrow (excluding font-size-*), with the suffix removed.
10
+ // New typography tokens are picked up on the next build, so there is no hand-maintained list.
11
+ $font-identifiers: ();
12
+
13
+ @each $name, $value in meta.module-variables('tokens') {
14
+ @if string.index($name, 'font-') == 1 and not string.index($name, 'font-size') {
15
+ @if string.index($name, '-size--narrow') {
16
+ $font-identifiers: list.append($font-identifiers, string.slice($name, 1, string.index($name, '-size--narrow') - 1), comma);
17
+ } @else if string.slice($name, -5) == '-size' {
18
+ $font-identifiers: list.append($font-identifiers, string.slice($name, 1, -6), comma);
19
+ }
20
+ }
21
+ }
22
+
23
+ // The pie-button sizes a pill can match, via height="button-{size}".
24
+ $button-sizes: ('xsmall', 'small-productive', 'small-expressive', 'medium', 'large');
2
25
 
3
26
  :host {
4
- // Note: For consistency sake, the recommended display should be either
5
- // "block" or "inline-block", otherwise it can be ommited for floating elements
6
27
  display: block;
28
+
29
+ // Skeletons are decorative, never interactive.
30
+ pointer-events: none;
31
+ }
32
+
33
+ .c-skeleton {
34
+ --skeleton-bg: var(--dt-color-skeleton-01);
35
+ --skeleton-border-radius: var(--dt-radius-rounded-b);
36
+ --skeleton-text-radius: var(--dt-radius-rounded-a);
37
+ --skeleton-star-size: var(--dt-spacing-e);
38
+
39
+ position: relative;
40
+ overflow: hidden;
41
+ width: 100%;
42
+ }
43
+
44
+ // Background colours
45
+ .c-skeleton--backgroundDefault {
46
+ --skeleton-bg: var(--dt-color-skeleton-01);
47
+ }
48
+
49
+ .c-skeleton--backgroundStrong {
50
+ --skeleton-bg: var(--dt-color-skeleton-02);
51
+ }
52
+
53
+ .c-skeleton--backgroundSubtle {
54
+ --skeleton-bg: var(--dt-color-skeleton-03);
55
+ }
56
+
57
+ // Shapes
58
+ .c-skeleton--box,
59
+ .c-skeleton--circle,
60
+ .c-skeleton--pill,
61
+ .c-skeleton-star {
62
+ background-color: var(--skeleton-bg);
63
+ }
64
+
65
+ // Box
66
+ .c-skeleton--box {
67
+ border-radius: var(--skeleton-border-radius);
68
+ }
69
+
70
+ .c-skeleton--radius-rounded-none {
71
+ --skeleton-border-radius: var(--dt-radius-rounded-none);
72
+ }
73
+
74
+ .c-skeleton--radius-rounded-a {
75
+ --skeleton-border-radius: var(--dt-radius-rounded-a);
76
+ }
77
+
78
+ .c-skeleton--radius-rounded-b {
79
+ --skeleton-border-radius: var(--dt-radius-rounded-b);
80
+ }
81
+
82
+ .c-skeleton--radius-rounded-c {
83
+ --skeleton-border-radius: var(--dt-radius-rounded-c);
84
+ }
85
+
86
+ .c-skeleton--radius-rounded-d {
87
+ --skeleton-border-radius: var(--dt-radius-rounded-d);
88
+ }
89
+
90
+ .c-skeleton--radius-rounded-e {
91
+ --skeleton-border-radius: var(--dt-radius-rounded-e);
92
+ }
93
+
94
+ .c-skeleton--radius-rounded-f {
95
+ --skeleton-border-radius: var(--dt-radius-rounded-f);
96
+ }
97
+
98
+ .c-skeleton--radius-rounded-g {
99
+ --skeleton-border-radius: var(--dt-radius-rounded-g);
100
+ }
101
+
102
+ // Box aspect ratios
103
+ .c-skeleton--1by1 {
104
+ aspect-ratio: 1 / 1;
105
+ }
106
+
107
+ .c-skeleton--4by3 {
108
+ aspect-ratio: 4 / 3;
109
+ }
110
+
111
+ .c-skeleton--16by9 {
112
+ aspect-ratio: 16 / 9;
113
+ }
114
+
115
+ .c-skeleton--3by4 {
116
+ aspect-ratio: 3 / 4;
117
+ }
118
+
119
+ .c-skeleton--9by16 {
120
+ aspect-ratio: 9 / 16;
121
+ }
122
+
123
+ // Circle
124
+ .c-skeleton--circle {
125
+ border-radius: 50%;
126
+ aspect-ratio: 1 / 1;
127
+ }
128
+
129
+ // Pill
130
+ .c-skeleton--pill {
131
+ // border-box keeps the reused button padding inside the pill's specified size,
132
+ // so its default width and any explicit height match the real button.
133
+ box-sizing: border-box;
134
+ border-radius: var(--dt-radius-rounded-e);
135
+ }
136
+
137
+ @each $size in $button-sizes {
138
+ .c-skeleton--button-#{$size} {
139
+ @include btn.button-padding-properties;
140
+ @include btn.button-size($size, 'c-skeleton');
141
+
142
+ line-height: var(--btn-line-height);
143
+
144
+ // A zero-width character makes the pill exactly one line box tall, like a button label.
145
+ &:before {
146
+ content: '\200b';
147
+ }
148
+ }
149
+ }
150
+
151
+ // Text
152
+ .c-skeleton-line {
153
+ @include p.font-theme('font-body-l');
154
+
155
+ position: relative;
156
+ border-radius: var(--skeleton-text-radius);
157
+
158
+ // A zero-width character makes the line exactly one line box tall.
159
+ &:before {
160
+ content: '\200b';
161
+ }
162
+
163
+ // The bar is the font size tall and centred in the line box.
164
+ &:after {
165
+ content: '';
166
+ position: absolute;
167
+ inset-inline: 0;
168
+ inset-block-start: 50%;
169
+ translate: 0 -50%;
170
+ block-size: 1em;
171
+ border-radius: var(--skeleton-text-radius);
172
+ background-color: var(--skeleton-bg);
173
+ }
174
+
175
+ // With more than one line, the last line is half width (set through the is-last class).
176
+ &.is-last:after {
177
+ inset-inline-end: 50%;
178
+ }
179
+ }
180
+
181
+ @each $identifier in $font-identifiers {
182
+ .c-skeleton-line--#{$identifier} {
183
+ @include p.font-theme($identifier);
184
+ }
185
+ }
186
+
187
+ // Star
188
+ .c-skeleton--star {
189
+ display: flex;
190
+ gap: 0;
191
+ width: fit-content;
192
+ }
193
+
194
+ .c-skeleton-star {
195
+ flex: 0 0 auto;
196
+ inline-size: var(--skeleton-star-size);
197
+ block-size: var(--skeleton-star-size);
198
+
199
+ // The PIE star icon (star-filled) masks the background into a star shape.
200
+ 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");
201
+ mask-position: center;
202
+ mask-repeat: no-repeat;
203
+ mask-size: contain;
7
204
  }