Skip to content

Commit

Permalink
fix: slide will now treat 0 as is instead of generating -0
Browse files Browse the repository at this point in the history
  • Loading branch information
xsjcTony committed Dec 1, 2023
1 parent fc3d756 commit 7281e1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const handleSlide = (
if (!value.startsWith('var(--') && ['top', 'left'].includes(dir ?? '')) {
if (value.startsWith('-'))
value = value.slice(1)
else
else if (value !== '0')
value = `-${value}`
}

Expand Down
4 changes: 2 additions & 2 deletions test/slide.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ describe('slide animation', () => {
.slide-in-t--70{--una-enter-translate-y:17.5rem;}
.slide-in-t--80{--una-enter-translate-y:20rem;}
.slide-in-t--90{--una-enter-translate-y:22.5rem;}
.slide-in-t-0{--una-enter-translate-y:-0;}
.slide-in-t-0{--una-enter-translate-y:0;}
.slide-in-t-10{--una-enter-translate-y:-2.5rem;}
.slide-in-t-100{--una-enter-translate-y:-25rem;}
.slide-in-t-110{--una-enter-translate-y:-27.5rem;}
Expand Down Expand Up @@ -510,7 +510,7 @@ describe('slide animation', () => {
.slide-out-t--70{--una-exit-translate-y:17.5rem;}
.slide-out-t--80{--una-exit-translate-y:20rem;}
.slide-out-t--90{--una-exit-translate-y:22.5rem;}
.slide-out-t-0{--una-exit-translate-y:-0;}
.slide-out-t-0{--una-exit-translate-y:0;}
.slide-out-t-10{--una-exit-translate-y:-2.5rem;}
.slide-out-t-100{--una-exit-translate-y:-25rem;}
.slide-out-t-110{--una-exit-translate-y:-27.5rem;}
Expand Down

0 comments on commit 7281e1d

Please sign in to comment.