Disable hover and active styles when button is disabled in primary/default variant (#14524)

Follow up of https://github.com/twentyhq/twenty/pull/14439.

After diving in, it seems primary/default is the only variant that
wasn't protected against this edge case.

## Before


https://github.com/user-attachments/assets/e7b1e61e-8db3-4e0e-82b4-e54c390e744b

## After


https://github.com/user-attachments/assets/bb3b2466-e63d-4727-b520-04f4578d579a
This commit is contained in:
Baptiste Devessier
2025-09-16 11:36:32 +02:00
committed by GitHub
parent 45362c0b12
commit b8ae7ddad9
@@ -88,16 +88,20 @@ const StyledButton = styled('button', {
? theme.font.color.secondary
: theme.font.color.extraLight
: theme.font.color.secondary};
&:hover {
background: ${!inverted
? theme.background.tertiary
: theme.background.secondary};
}
&:active {
background: ${!inverted
? theme.background.quaternary
: theme.background.tertiary};
}
${disabled
? ''
: css`
&:hover {
background: ${!inverted
? theme.background.tertiary
: theme.background.secondary};
}
&:active {
background: ${!inverted
? theme.background.quaternary
: theme.background.tertiary};
}
`}
`;
case 'blue':
return css`