Skip to content
Merged
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
40 changes: 16 additions & 24 deletions packages/uui-menu-item/lib/uui-menu-item.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
render() {
return html`
<div id="menu-item" aria-label="menuitem" role="menuitem">
<div id="label-button-background"></div>
${this.hasChildren
? html`<button
id="caret-button"
Expand All @@ -231,7 +232,6 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
? this._renderLabelAsAnchor()
: this._renderLabelAsButton()}

<div id="label-button-background"></div>
<slot id="actions-container" name="actions"></slot>
${this.loading
? html`<uui-loader-bar id="loader"></uui-loader-bar>`
Expand Down Expand Up @@ -266,12 +266,8 @@ export class UUIMenuItemElement extends SelectOnlyMixin(

/** Not active, not selected, not disabled: */
:host(:not([active], [selected], [disabled], [select-mode='highlight']))
#menu-item
#label-button:hover
~ #label-button-background,
:host(:not([active], [selected], [disabled]))
#menu-item
#caret-button:hover {
#menu-item:has(#label-button:hover)
#label-button-background {
background-color: var(
--uui-menu-item-background-color-hover,
var(--uui-color-surface-emphasis)
Expand Down Expand Up @@ -301,7 +297,9 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
var(--uui-color-current)
);
}
:host([active]) #label-button:hover ~ #label-button-background,
:host([active])
#menu-item:has(#label-button:hover)
#label-button-background,
:host([active]) #caret-button:hover {
background-color: var(
--uui-menu-item-background-color-active-hover,
Expand Down Expand Up @@ -336,8 +334,8 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
}
/** Selected, not highlight mode */
:host([selected]:not([select-mode='highlight'], [disabled]))
#label-button:hover
~ #label-button-background,
#menu-item:has(#label-button:hover)
#label-button-background,
:host([selected]:not([select-mode='highlight'], [disabled]))
#caret-button:hover {
background-color: var(
Expand All @@ -348,9 +346,8 @@ export class UUIMenuItemElement extends SelectOnlyMixin(

/** highlight mode, default */
:host([select-mode='highlight']:not([disabled], [active], [selectable]))
#menu-item
#label-button:hover
~ #label-button-background {
#menu-item:has(#label-button:hover)
#label-button-background {
border-radius: var(--uui-border-radius);
background-color: var(
--uui-menu-item-background-color-highlight,
Expand All @@ -367,9 +364,8 @@ export class UUIMenuItemElement extends SelectOnlyMixin(

/** highlight mode, active & selected */
:host([select-mode='highlight'][active][selected]:not([disabled]))
#menu-item
#label-button:hover
~ #label-button-background {
#menu-item:has(#label-button:hover)
#label-button-background {
border-radius: var(--uui-border-radius);
background-color: var(
--uui-menu-item-background-color-highlight-active-selected,
Expand Down Expand Up @@ -447,15 +443,13 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
}

:host([select-mode='highlight'][selectable]:not([disabled]))
#menu-item
#label-button:hover
~ #label-button-background::after {
#menu-item:has(#label-button:hover)
#label-button-background::after {
opacity: 0.33;
}
:host([select-mode='highlight'][selected]:not([disabled]))
#menu-item
#label-button:hover
~ #label-button-background::after {
#menu-item:has(#label-button:hover)
#label-button-background::after {
opacity: 0.66;
}

Expand All @@ -480,7 +474,6 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
background-color: transparent;
cursor: pointer;
min-height: var(--uui-size-12);
z-index: 1;
}

#label-button {
Expand All @@ -498,7 +491,6 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
text-decoration: none;
color: currentColor;
min-height: var(--uui-size-12);
z-index: 1;
font-weight: inherit;
}

Expand Down
Loading