Skip to content

Commit

Permalink
Small Switch off state color change (#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
pomfrida committed Jul 6, 2020
1 parent ddc154b commit a89c089
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions libraries/core-react/src/SelectionControls/Switch/Input.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ const SmallInput = styled(BaseInput)`
&[data-focus-visible-added]:focus + span :first-child {
outline-offset: ${enabled.outlineOffsetSmall};
}
/* Track */
&:checked + span > span {
background-color: ${({ disabled }) =>
disabled ? _disabled.background : enabled.track.small.background};
}
/* Handle */
&:checked + span > span:last-child {
background-color: ${enabled.handle.small.background};
}
`
const DefaultInput = styled(BaseInput)`
/* Track */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const switchControl = {
width: '20px',
height: '10px',
background: primaryResting,
offBackground: handleColor,
},
},
handle: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Track = styled.span`
border-radius: 10px;
border: none;
background-color: ${({ isDisabled }) =>
isDisabled ? _disabled.background : enabled.track.small.background};
isDisabled ? _disabled.background : enabled.track.small.offBackground};
position: absolute;
left: 50%;
top: 50%;
Expand Down

0 comments on commit a89c089

Please sign in to comment.