Skip to content

Commit

Permalink
fix: toggle icon misalignment
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromeraffin committed Feb 5, 2024
1 parent ec05893 commit 7d58f20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 0 additions & 3 deletions packages/Core/src/theme/toggles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,14 @@ export const getToggles = (theme: WuiTheme): ThemeToggles => {
icon: {
position: {
xs: {
top: '5px',
left: '2px',
right: '2px',
},
sm: {
top: '1px',
left: '4px',
right: '4px',
},
md: {
top: '4px',
left: '4px',
right: '4px',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/Toggle/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const Toggle = forwardRef<'input', ToggleProps>(
return (
<S.Wrapper onClick={onClick}>
{hasIcon && (
<S.IconWrapper checked={checked} size={size}>
<S.IconWrapper checked={checked} onClick={onClick} size={size}>
{checked ? checkedIcon : uncheckedIcon}
</S.IconWrapper>
)}
Expand Down
5 changes: 4 additions & 1 deletion packages/Toggle/src/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ export const IconWrapper = styled.box.withConfig({ shouldForwardProp })<{
({ checked, size }) => css`
position: absolute;
z-index: 1;
top: ${th(`toggles.icon.position.${size}.top`)};
display: flex;
align-items: center;
height: ${th(`toggles.item.sizes.${size}.height`)};
bottom: 0;
> svg,
i {
Expand Down

0 comments on commit 7d58f20

Please sign in to comment.