Skip to content

Commit 59ea089

Browse files
committed
💄 Change Skeleton width and height to max to improve responsiveness
1 parent 8e94c6b commit 59ea089

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/components/Skeleton/Skeleton.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ const classes = [
2525
]
2626
2727
const styleVariables = classNames([
28-
width && `width: ${width}px;`,
29-
height && `height: ${height}px;`,
28+
width && `max-width: ${width}px;`,
29+
height && `max-height: ${height}px;`,
3030
color && `--w-skeleton-color: ${color};`,
3131
waveColor && `--w-skeleton-wave-color: ${waveColor};`
3232
])

src/components/Skeleton/Skeleton.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
])
2222
2323
const styleVariables = classNames([
24-
width && `width: ${width}px;`,
25-
height && `height: ${height}px;`,
24+
width && `max-width: ${width}px;`,
25+
height && `max-height: ${height}px;`,
2626
color && `--w-skeleton-color: ${color};`,
2727
waveColor && `--w-skeleton-wave-color: ${waveColor};`
2828
])

src/components/Skeleton/Skeleton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ const Skeleton = ({
2222
])
2323

2424
const styleVariables = {
25-
...(width && { width: `${width}px` }),
26-
...(height && { height: `${height}px` }),
25+
...(width && { maxWidth: `${width}px` }),
26+
...(height && { maxHeight: `${height}px` }),
2727
...(color && { '--w-skeleton-color': color }),
2828
...(waveColor && { '--w-skeleton-wave-color': waveColor })
2929
} as React.CSSProperties

0 commit comments

Comments
 (0)