Skip to content

Commit

Permalink
feat: Toggle 컴포넌트 애니메이션 추가 (#113)
Browse files Browse the repository at this point in the history
* feat: Toggle 컴포넌트 애니메이션 추가

* changeset
  • Loading branch information
Brokyeom authored Aug 19, 2024
1 parent 02023a2 commit 1138350
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-years-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sopt-makers/ui": patch
---

Toggle 컴포넌트 애니메이션 추가
11 changes: 6 additions & 5 deletions packages/ui/Control/style.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,17 @@ const toggleBase = style({
border: 'none',
boxSizing: 'border-box',
cursor: 'pointer',
justifyContent: 'flex-start',
});

const toggleThumbBase = style({
display: 'block',
borderRadius: '9999px',
backgroundColor: theme.colors.white,
filter: 'drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.20))',
transform: 'translateX(0)',
transition: 'transform 200ms',
willChange: 'transform',
});

export const toggleWrapper = styleVariants({
Expand All @@ -118,11 +122,8 @@ export const toggleWrapper = styleVariants({
});

export const toggleState = styleVariants({
true: { justifyContent: 'flex-end', backgroundColor: theme.colors.blue400 },
false: {
justifyContent: 'flex-start',
backgroundColor: theme.colors.gray400,
},
true: { 'backgroundColor': theme.colors.blue400, '& > span[data-state="true"]': { transform: 'translateX(100%)' } },
false: { backgroundColor: theme.colors.gray400 },
});

export const toggleThumb = styleVariants({
Expand Down

0 comments on commit 1138350

Please sign in to comment.