Skip to content

Commit 4d036fb

Browse files
natainakataSidnioulz
authored andcommitted
fix: high contrast mode support for boolean
1 parent b640480 commit 4d036fb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

code/addons/docs/src/blocks/controls/Boolean.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ const Label = styled.label(({ theme }) => ({
4545
outline: 'none',
4646
boxShadow: `${theme.color.secondary} 0 0 0 1px inset !important`,
4747
},
48+
'@media (forced-colors: active)': {
49+
'&:focus': {
50+
outlineColor: 'transparent',
51+
outlineWidth: '1px',
52+
outlineStyle: 'solid',
53+
},
54+
},
4855
},
4956

5057
span: {
@@ -88,6 +95,11 @@ const Label = styled.label(({ theme }) => ({
8895
color: theme.color.defaultText,
8996
padding: '7px 15px',
9097
},
98+
'@media (forced-colors: active)': {
99+
'input:checked ~ span:last-of-type, input:not(:checked) ~ span:first-of-type': {
100+
textDecoration: 'underline',
101+
},
102+
},
91103
}));
92104

93105
const parse = (value: string | null): boolean => value === 'true';

0 commit comments

Comments
 (0)