Skip to content

Commit bc4c982

Browse files
fix(skeleton): fixed shimmer animation still plays when disableAnimation is true (#5916)
* fix(skeleton): restore shimmer animation for background transition * chore: changeset * chore(skeleton): bump theme peer dep * chore(skeleton): pass args to first skeleton * chore(changeset): bump skeleton --------- Co-authored-by: WK Wong <[email protected]>
1 parent 8921dc4 commit bc4c982

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

.changeset/tiny-hairs-collect.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@heroui/theme": patch
3+
"@heroui/skeleton": patch
4+
---
5+
6+
fixed skeleton shimmer animation not respecting disableAnimation prop (#5915)

packages/components/skeleton/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"peerDependencies": {
3737
"react": ">=18 || >=19.0.0-rc.0",
3838
"react-dom": ">=18 || >=19.0.0-rc.0",
39-
"@heroui/theme": ">=2.4.17",
39+
"@heroui/theme": ">=2.4.23",
4040
"@heroui/system": ">=2.4.18"
4141
},
4242
"dependencies": {

packages/components/skeleton/stories/skeleton.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const DefaultTemplate = (args: SkeletonProps) => (
5656
const StandaloneTemplate = (args: SkeletonProps) => (
5757
<div className="max-w-[300px] w-full flex items-center gap-3">
5858
<div>
59-
<Skeleton className="flex rounded-full w-12 h-12" />
59+
<Skeleton className="flex rounded-full w-12 h-12" {...args} />
6060
</div>
6161
<div className="w-full flex flex-col gap-2">
6262
<Skeleton className="h-3 w-3/5 rounded-lg" {...args} />

packages/core/theme/src/components/skeleton.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const skeleton = tv({
2525
"before:absolute",
2626
"before:inset-0",
2727
"before:-translate-x-full",
28-
"before:animate-shimmer",
2928
"before:border-t",
3029
"before:border-content4/30",
3130
"before:bg-gradient-to-r",
@@ -56,7 +55,7 @@ const skeleton = tv({
5655
content: "transition-none",
5756
},
5857
false: {
59-
base: "transition-background !duration-300",
58+
base: "before:animate-shimmer transition-background !duration-300",
6059
content: "transition-opacity motion-reduce:transition-none !duration-300",
6160
},
6261
},

0 commit comments

Comments
 (0)