Skip to content

Commit

Permalink
fix(ui5-menu-item): add hover and active styles (#9774)
Browse files Browse the repository at this point in the history
Previously, there were no visual indicators when hovering over a menu item, aside from the focus border. With this change, we're adding `hover` and `active` styles to the menu items.
  • Loading branch information
hinzzx authored Aug 30, 2024
1 parent caaf09c commit 55a4179
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/main/src/themes/MenuItem.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,23 @@
background: var(--ui5-listitem-background-color);
}

:host([active]:not([disabled])),
:host([active]:not([disabled])):hover {
background-color: var(--sapList_Active_Background);
}

:host(:not([active]):not([selected]):not([disabled]):hover) {
background-color: var(--sapList_Hover_Background);
}

/* active */
:host([disabled][active][actionable]) .ui5-li-root .ui5-li-icon {
color: var(--sapContent_NonInteractiveIconColor);
}

:host([active][actionable]:not([disabled]))::part(content),
:host([active][actionable]:not([disabled]))::part(additional-text) {
:host([active]:not([disabled]))::part(content),
:host([active]:not([disabled]))::part(additional-text),
:host([active]:not([disabled])) .ui5-li-root .ui5-li-icon {
color: var(--sapList_Active_TextColor);
}

Expand Down

0 comments on commit 55a4179

Please sign in to comment.