Handle single items better

This commit is contained in:
Andy Smith
2025-05-22 13:53:51 -05:00
parent 72e049091a
commit d8ed61b08f
+10 -2
View File
@@ -69,8 +69,7 @@
z-index: calc(var(--z-tray) + 1);
.tray__dialog[open] ~ &,
.tray__dialog:not(:has(.tray__item:not(.tray__item--overflow))) ~ &,
.tray__dialog:has(.tray__item:not(.tray__item--overflow):only-child) ~ & {
.tray__dialog:not(:has(.tray__item:not(.tray__item--overflow))) ~ & {
display: none;
}
}
@@ -237,6 +236,15 @@
.tray--pins {
inset-inline: var(--tray-margin) auto;
/* Don't expand if there's only one pin */
.tray__dialog:has(.tray__item:only-child) {
pointer-events: unset;
~ .tray__expander {
display: none;
}
}
.tray__item {
--tray-item-z: calc(10 - var(--tray-item-index));