Skip to content

Commit

Permalink
fix(Switch): different off style
Browse files Browse the repository at this point in the history
  • Loading branch information
LexSwed committed Oct 8, 2020
1 parent 3d4bf1c commit e7cd3d5
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/lib/Switch/Switch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,20 @@ const Wrapper = styled(Flex, {

const Toggle = styled(Flex, {
'br': '$pill',
'bc': '$surfaceStill',
'bc': '$borderStill',
'border': '1px solid $borderStill',
'height': '$4',
'width': '$6',
'position': 'relative',
'transition': '0.24s ease-in-out',
'boxShadow': '$inner',

'::before': {
content: `''`,
display: 'block',
position: 'absolute',
size: '$3',
bc: '$borderHover',
bc: '#fff',
br: '$round',
transition: '0.24s ease-in-out',
top: '1px',
Expand All @@ -49,15 +50,14 @@ const Input = styled('input', {
transition: '0.24s ease-in-out',

[`&:hover:not(:checked) + ${Toggle}`]: {
'boxShadow': '$inner',
'&::before': {
bc: '$borderActive',
boxShadow: '$sm',
},
},

[`&:focus:not(:checked) + ${Toggle}`]: {
'::before': {
bc: '$borderActive',
boxShadow: '$md',
},
},

Expand All @@ -71,16 +71,15 @@ const Input = styled('input', {
},

[`&:focus:not(:checked)[${attribute}] + ${Toggle}`]: {
'bc': '$surfaceStill',
'::before': {
boxShadow: '0 0 0 1px $surfaceStill, 0 0 0 2px $borderActive',
boxShadow: '0 0 0 1px $borderStill , 0 0 0 3px $borderActive',
},
},

[`&:focus:checked[${attribute}] + ${Toggle}`]: {
'::before': {
borderColor: 'transparent',
boxShadow: '0 0 0 1px $primaryStill, 0 0 0 2px $borderActive',
boxShadow: '0 0 0 1px $primaryStill, 0 0 0 3px $borderActive',
},
},

Expand All @@ -95,7 +94,6 @@ const Input = styled('input', {
[`&:checked:hover + ${Toggle}, &:checked:focus + ${Toggle}`]: {
bc: '$primaryHover',
borderColor: '$primaryHover',
boxShadow: '$base',
},
});

Expand Down

1 comment on commit e7cd3d5

@vercel
Copy link

@vercel vercel bot commented on e7cd3d5 Oct 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.