Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions code/core/src/components/components/ActionBar/ActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ export const ActionButton = styled.button<{ disabled: boolean }>(
boxShadow: `${theme.color.secondary} 0 -3px 0 0 inset`,
outline: '0 none',
},

'@media (forced-colors: active)': {
'&:focus': {
outline: '1px solid highlight',
},
},
}),
({ disabled }) =>
disabled && {
Expand Down
5 changes: 5 additions & 0 deletions code/core/src/components/components/form/input/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ const styles = (({ theme }: { theme: StorybookTheme }) => ({
boxShadow: `${theme.color.secondary} 0 0 0 1px inset`,
outline: 'none',
},
'@media (forced-colors: active)': {
'&:focus': {
outline: '1px solid highlight',
},
},
'&[disabled]': {
cursor: 'not-allowed',
opacity: 0.5,
Expand Down
10 changes: 10 additions & 0 deletions code/lib/blocks/src/controls/Boolean.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ const Label = styled.label(({ theme }) => ({
outline: 'none',
boxShadow: `${theme.color.secondary} 0 0 0 1px inset !important`,
},
'@media (forced-colors: active)': {
'&:focus': {
outline: '1px solid highlight',
},
},
},

span: {
Expand Down Expand Up @@ -88,6 +93,11 @@ const Label = styled.label(({ theme }) => ({
color: theme.color.defaultText,
padding: '7px 15px',
},
'@media (forced-colors: active)': {
Copy link
Contributor

Choose a reason for hiding this comment

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

If I remember correctly, you can nest media queries in the above selector (below line 94) which should result in not needing to duplicate a complex selector like this one. It's just slightly tidier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Media queries are now nested.
Applied to other changes as well.

'input:checked ~ span:last-of-type, input:not(:checked) ~ span:first-of-type': {
textDecoration: 'underline',
},
},
}));

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