Skip to content

Commit

Permalink
refactor: remove unneeded tabIndex. Create border helper
Browse files Browse the repository at this point in the history
remove unneeded tabIndex. Create accessible border helper
  • Loading branch information
ehoops-zz committed Nov 29, 2023
1 parent 022ffd9 commit 29fcbd9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
6 changes: 2 additions & 4 deletions packages/components/src/core/Button/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
getCorners,
getSpaces,
} from "../styles";
import { focusVisibleA11yStyle } from "../styles/common/mixins/a11y";

const sdsPropNames = ["isAllCaps", "isRounded", "sdsStyle", "sdsType"];

Expand All @@ -32,6 +33,7 @@ const ButtonBase = styled(Button, {
return `
${outlineBorder}
${focusVisibleA11yStyle()}
padding: ${padding};
min-width: 120px;
height: 34px;
Expand All @@ -40,10 +42,6 @@ const ButtonBase = styled(Button, {
background-color: ${colors?.primary[500]};
box-shadow: none;
}
&:focus-visible {
outline: 5px auto Highlight;
outline: 5px auto -webkit-focus-ring-color;
}
&:active {
color: white;
background-color: ${colors?.primary[600]};
Expand Down
1 change: 0 additions & 1 deletion packages/components/src/core/InputCheckbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ const InputCheckbox = (props: CheckboxProps): JSX.Element => {
caption={caption}
control={
<StyledCheckbox
tabIndex={0}
disabled={disabled}
checkedIcon={
<SvgIcon
Expand Down
6 changes: 2 additions & 4 deletions packages/components/src/core/InputCheckbox/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
} from "@mui/material";
import { styled } from "@mui/material/styles";
import { fontBodyXxs } from "../styles";
import { focusVisibleA11yStyle } from "../styles/common/mixins/a11y";
import {
CommonThemeProps,
getColors,
Expand Down Expand Up @@ -69,10 +70,7 @@ export const StyledCheckbox = styled(RawCheckbox)`
}
&.MuiCheckbox-root {
&.Mui-focusVisible {
outline: 5px auto Highlight;
outline: 5px auto -webkit-focus-ring-color;
}
${focusVisibleA11yStyle()}
border-radius: ${corners?.s}px;
padding: ${spaces?.xxs}px;
margin: 3px;
Expand Down

0 comments on commit 29fcbd9

Please sign in to comment.