diff --git a/libraries/core-react/src/SelectionControls/Switch/Input.jsx b/libraries/core-react/src/SelectionControls/Switch/Input.jsx index 1c6e063efd..0f60e6d441 100644 --- a/libraries/core-react/src/SelectionControls/Switch/Input.jsx +++ b/libraries/core-react/src/SelectionControls/Switch/Input.jsx @@ -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 */ diff --git a/libraries/core-react/src/SelectionControls/Switch/Switch.tokens.js b/libraries/core-react/src/SelectionControls/Switch/Switch.tokens.js index 47cceab563..64b9627527 100644 --- a/libraries/core-react/src/SelectionControls/Switch/Switch.tokens.js +++ b/libraries/core-react/src/SelectionControls/Switch/Switch.tokens.js @@ -41,6 +41,7 @@ export const switchControl = { width: '20px', height: '10px', background: primaryResting, + offBackground: handleColor, }, }, handle: { diff --git a/libraries/core-react/src/SelectionControls/Switch/SwitchSmall.jsx b/libraries/core-react/src/SelectionControls/Switch/SwitchSmall.jsx index ea5c6b9e59..919e440a86 100644 --- a/libraries/core-react/src/SelectionControls/Switch/SwitchSmall.jsx +++ b/libraries/core-react/src/SelectionControls/Switch/SwitchSmall.jsx @@ -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%;