Skip to content

Commit

Permalink
fix(odyssey-react): accessible focus states for Dismiss Button
Browse files Browse the repository at this point in the history
  • Loading branch information
edburyenegren-okta committed Apr 8, 2022
1 parent 95ea4af commit fc7546d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
16 changes: 2 additions & 14 deletions packages/odyssey-react/src/components/Button/Button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,9 @@
color: var(--DismissTextColor);
line-height: var(--DismissLineHeight);

&:hover {
border-color: var(--DismissHoverBorderColor);
background-color: var(--DismissHoverBackgroundColor);
}

&:hover,
&:focus {
background-color: var(--DismissFocusBackgroundColor);
box-shadow: 0 0 0 2px;
background-color: rgba(var(--DismissHoverBackgroundColor), var(--DismissHoverBackgroundOpacity));
}

&:disabled {
Expand All @@ -141,16 +136,9 @@

.icon {
display: block;
margin-block-start: 0.0625em;
margin-block-end: -0.0625em;
line-height: 0.9;
}
}

.dismissInvertedVariant:focus {
box-shadow: 0 0 0 2px var(--DismissInvertedBoxShadowColor);
}

.clearVariant {
background-color: var(--ClearBackgroundColor);
color: var(--ClearTextColor);
Expand Down
4 changes: 2 additions & 2 deletions packages/odyssey-react/src/components/Button/Button.theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ export const theme: ThemeReducer = (theme) => ({

// Dismiss Variant
DismissBackgroundColor: "transparent",
DismissHoverBorderColor: "transparent",
DismissTextColor: "inherit",
DismissDisabledTextColor: theme.ColorNeutralBase,
DismissLineHeight: 1,
DismissPaddingBlock: theme.SpaceScale0,
DismissPaddingInline: theme.SpaceScale0,
DismissHoverBackgroundColor: "rgba(255, 255, 255, 0.6)",
DismissHoverBackgroundColor: "29, 29, 33",
DismissHoverBackgroundOpacity: 0.1,
DismissFocusBackgroundColor: "rgba(255, 255, 255, 0.6)",
DismissDisabledBackgroundColor: "rgba(235, 235, 237, 0.6)",

Expand Down

0 comments on commit fc7546d

Please sign in to comment.