Skip to content
Merged
12 changes: 6 additions & 6 deletions src/icon-button.css.ts
Comment thread
aweell marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -280,24 +280,24 @@ export const iconButtonTokens = styleVariants({
'danger-transparent-default': {
vars: {
[background]: 'transparent',
[backgroundHover]: skinVars.colors.backgroundContainerHover,
[backgroundActive]: skinVars.colors.backgroundContainerPressed,
[backgroundHover]: skinVars.colors.buttonLinkDangerBackgroundPressed,
[backgroundActive]: skinVars.colors.buttonLinkDangerBackgroundPressed,
Comment thread
atabel marked this conversation as resolved.
[iconColor]: skinVars.colors.error,
},
},
'danger-transparent-brand': {
vars: {
[background]: skinVars.colors.buttonLinkDangerBackgroundBrand,
[backgroundHover]: skinVars.colors.backgroundContainerHover,
[backgroundActive]: skinVars.colors.backgroundContainerPressed,
[backgroundHover]: skinVars.colors.buttonLinkDangerBackgroundPressed,
[backgroundActive]: skinVars.colors.buttonLinkDangerBackgroundPressed,
[iconColor]: skinVars.colors.error,
},
},
'danger-transparent-negative': {
vars: {
[background]: skinVars.colors.buttonLinkDangerBackgroundBrand,
[backgroundHover]: skinVars.colors.backgroundContainerHover,
[backgroundActive]: skinVars.colors.backgroundContainerPressed,
[backgroundHover]: skinVars.colors.buttonLinkDangerBackgroundPressed,
[backgroundActive]: skinVars.colors.buttonLinkDangerBackgroundPressed,
[iconColor]: skinVars.colors.error,
},
},
Expand Down
14 changes: 14 additions & 0 deletions src/menu.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ export const menuItemHovered = style({
},
});

export const menuItemHoveredDestructive = style({
transition: 'background-color 0.1s ease-in-out',
backgroundColor: skinVars.colors.buttonLinkDangerBackgroundPressed,
':active': {
backgroundColor: skinVars.colors.buttonLinkDangerBackgroundPressed,
},
'@media': {
[mq.touchableOnly]: {
backgroundColor: 'transparent',
transition: 'none',
},
},
});

export const menuItemEnabled = style({
'@media': {
[mq.touchableOnly]: {
Expand Down
5 changes: 4 additions & 1 deletion src/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,10 @@ export const MenuItem = ({
className={classnames(styles.menuItem, {
[styles.menuItemEnabled]: !disabled,
[styles.menuItemDisabled]: disabled,
[styles.menuItemHovered]: !disabled && itemIndex !== null && focusedItem === itemIndex,
[styles.menuItemHovered]:
!disabled && !destructive && itemIndex !== null && focusedItem === itemIndex,
[styles.menuItemHoveredDestructive]:
!disabled && destructive && itemIndex !== null && focusedItem === itemIndex,
})}
onMouseMove={() => setFocusedItem(disabled ? null : itemIndex)}
onMouseLeave={() => setFocusedItem(null)}
Expand Down
Loading