@@ -223,6 +223,7 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
223
223
render ( ) {
224
224
return html `
225
225
<div id= "menu-item" aria-label = "menuitem" role= "menuitem">
226
+ <div id= "label-button-background" > </ div>
226
227
${ this . hasChildren
227
228
? html `<butto n
228
229
id= "caret-button"
@@ -239,7 +240,6 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
239
240
? this . _renderLabelAsAnchor ( )
240
241
: this . _renderLabelAsButton ( ) }
241
242
242
- <div id= "label-button-background" > </ div>
243
243
<slot id= "actions-container" name = "actions"> </ slot>
244
244
${ this . loading
245
245
? html `<uui- loader- bar id= "loader" > </ uui- loader- bar> `
@@ -274,12 +274,8 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
274
274
275
275
/** Not active, not selected, not disabled: */
276
276
: host (: not ([active ], [selected ], [disabled ], [select-mode = 'highlight' ]))
277
- # menu-item
278
- # label-button : hover
279
- ~ # label-button-background ,
280
- : host (: not ([active ], [selected ], [disabled ]))
281
- # menu-item
282
- # caret-button : hover {
277
+ # menu-item : has (# label-button : hover )
278
+ # label-button-background {
283
279
background-color : var (
284
280
--uui-menu-item-background-color-hover ,
285
281
var (--uui-color-surface-emphasis )
@@ -309,7 +305,9 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
309
305
var (--uui-color-current )
310
306
);
311
307
}
312
- : host ([active ]) # label-button : hover ~ # label-button-background ,
308
+ : host ([active ])
309
+ # menu-item : has (# label-button : hover )
310
+ # label-button-background ,
313
311
: host ([active ]) # caret-button : hover {
314
312
background-color : var (
315
313
--uui-menu-item-background-color-active-hover ,
@@ -344,8 +342,8 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
344
342
}
345
343
/** Selected, not highlight mode */
346
344
: host ([selected ]: not ([select-mode = 'highlight' ], [disabled ]))
347
- # label-button : hover
348
- ~ # label-button-background ,
345
+ # menu-item : has ( # label-button : hover)
346
+ # label-button-background ,
349
347
: host ([selected ]: not ([select-mode = 'highlight' ], [disabled ]))
350
348
# caret-button : hover {
351
349
background-color : var (
@@ -356,9 +354,8 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
356
354
357
355
/** highlight mode, default */
358
356
: host ([select-mode = 'highlight' ]: not ([disabled ], [active ], [selectable ]))
359
- # menu-item
360
- # label-button : hover
361
- ~ # label-button-background {
357
+ # menu-item : has (# label-button : hover )
358
+ # label-button-background {
362
359
border-radius : var (--uui-border-radius );
363
360
background-color : var (
364
361
--uui-menu-item-background-color-highlight ,
@@ -375,9 +372,8 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
375
372
376
373
/** highlight mode, active & selected */
377
374
: host ([select-mode = 'highlight' ][active ][selected ]: not ([disabled ]))
378
- # menu-item
379
- # label-button : hover
380
- ~ # label-button-background {
375
+ # menu-item : has (# label-button : hover )
376
+ # label-button-background {
381
377
border-radius : var (--uui-border-radius );
382
378
background-color : var (
383
379
--uui-menu-item-background-color-highlight-active-selected ,
@@ -455,15 +451,13 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
455
451
}
456
452
457
453
: host ([select-mode = 'highlight' ][selectable ]: not ([disabled ]))
458
- # menu-item
459
- # label-button : hover
460
- ~ # label-button-background ::after {
454
+ # menu-item : has (# label-button : hover )
455
+ # label-button-background ::after {
461
456
opacity : 0.33 ;
462
457
}
463
458
: host ([select-mode = 'highlight' ][selected ]: not ([disabled ]))
464
- # menu-item
465
- # label-button : hover
466
- ~ # label-button-background ::after {
459
+ # menu-item : has (# label-button : hover )
460
+ # label-button-background ::after {
467
461
opacity : 0.66 ;
468
462
}
469
463
@@ -488,7 +482,6 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
488
482
background-color : transparent;
489
483
cursor : pointer;
490
484
min-height : var (--uui-size-12 );
491
- z-index : 1 ;
492
485
}
493
486
494
487
# label-button {
@@ -506,7 +499,6 @@ export class UUIMenuItemElement extends SelectOnlyMixin(
506
499
text-decoration : none;
507
500
color : currentColor;
508
501
min-height : var (--uui-size-12 );
509
- z-index : 1 ;
510
502
font-weight : inherit;
511
503
}
512
504
0 commit comments