set a relative color on menu triggers when open

This commit is contained in:
Gazook89
2026-07-08 23:36:08 -05:00
parent 6f1ad35492
commit c5db25f076
+7 -1
View File
@@ -1,4 +1,6 @@
:root{
--menuColor : var(--menu-color, #DDD);
}
.menu-list {
contain : content;
position : fixed;
@@ -7,10 +9,14 @@
left : anchor(left);
position-try: flip-inline flip-block;
color: inherit; // [popover] gets a `canvastext` color value from useragent.
background: var(--menuColor);
li > .menu-list {
margin: 0 0px;
top : anchor(top);
left : anchor(right);
position-try: flip-inline;
}
}
.menu-wrapper:has(:popover-open) > button { // if menu is open...
background-color: hsl(from var(--menuColor) h s calc(l * .85)); // tint menu triggers based on menu color
}