Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Button styles + support for aria-expanded #2421

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all 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
47 changes: 22 additions & 25 deletions packages/odyssey-react-mui/src/theme/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ export const components = ({
backgroundColor: odysseyTokens.PalettePrimaryDark,
},

"&:active": {
"&:active, &[aria-expanded='true']": {
backgroundColor: odysseyTokens.PalettePrimaryDarker,
},

Expand All @@ -667,27 +667,20 @@ export const components = ({
color: odysseyTokens.TypographyColorBody,

"&:hover": {
backgroundColor: odysseyTokens.HueNeutral100,
backgroundColor: odysseyTokens.HueNeutral200,
borderColor: odysseyTokens.HueNeutral400,
},

"&:active": {
"&:active, &[aria-expanded='true']": {
backgroundColor: "transparent",
borderColor: odysseyTokens.BorderColorPrimaryControl,
color: odysseyTokens.TypographyColorAction,
},

"&:disabled": {
...(contrastMode === "highContrast" && {
backgroundColor: odysseyTokens.HueNeutral200,
borderColor: "transparent",
color: odysseyTokens.TypographyColorDisabled,
}),

...(contrastMode === "lowContrast" && {
backgroundColor: odysseyTokens.HueNeutral100,
borderColor: "transparent",
color: odysseyTokens.TypographyColorDisabled,
}),
backgroundColor: odysseyTokens.HueNeutral200,
borderColor: "transparent",
color: odysseyTokens.TypographyColorDisabled,
},
}),

Expand All @@ -703,7 +696,7 @@ export const components = ({
boxShadow: `0 0 0 2px ${odysseyTokens.HueNeutralWhite}, 0 0 0 4px ${odysseyTokens.PaletteDangerMain}`,
},

"&:active": {
"&:active, &[aria-expanded='true']": {
backgroundColor: odysseyTokens.PaletteDangerDarker,
},

Expand All @@ -719,19 +712,20 @@ export const components = ({
color: odysseyTokens.PaletteDangerMain,

"&:hover": {
backgroundColor: odysseyTokens.HueNeutral100,
backgroundColor: odysseyTokens.HueNeutral200,
borderColor: odysseyTokens.HueNeutral400,
color: odysseyTokens.PaletteDangerMain,
},

"&:active": {
"&:active, &[aria-expanded='true']": {
backgroundColor: "transparent",
borderColor: odysseyTokens.PaletteDangerMain,
color: odysseyTokens.PaletteDangerMain,
},

"&:disabled": {
backgroundColor: "transparent",
borderColor: odysseyTokens.PaletteDangerLight,
backgroundColor: odysseyTokens.PaletteDangerHighlight,
borderColor: "transparent",
color: odysseyTokens.PaletteDangerLight,
},
}),
Expand All @@ -741,11 +735,13 @@ export const components = ({
color: odysseyTokens.TypographyColorBody,

"&:hover": {
backgroundColor: odysseyTokens.HueNeutral100,
backgroundColor: odysseyTokens.HueNeutral200,
},

"&:active": {
backgroundColor: odysseyTokens.HueNeutral200,
"&:active, &[aria-expanded='true']": {
backgroundColor: "transparent",
color: odysseyTokens.HueBlue600,
borderColor: odysseyTokens.HueBlue600,
},

"&:disabled": {
Expand All @@ -759,11 +755,12 @@ export const components = ({
color: odysseyTokens.TypographyColorAction,

"&:hover": {
backgroundColor: odysseyTokens.HueNeutral100,
backgroundColor: odysseyTokens.HueNeutral200,
},

"&:active": {
backgroundColor: odysseyTokens.HueNeutral200,
"&:active, &[aria-expanded='true']": {
backgroundColor: "transparent",
borderColor: odysseyTokens.HueBlue600,
},

"&:disabled": {
Expand Down