Add custom properties to dropdown.less

Adds registered custom properties to the dropdown menus, which can be set in another stylesheet at any level (either on the direct element or on an ancestor) or use the default values given.
This commit is contained in:
Gazook89
2026-07-09 14:13:22 -05:00
parent 794c2fa09d
commit 5d67d48436
2 changed files with 13 additions and 8 deletions
+13 -3
View File
@@ -1,10 +1,20 @@
@property --menuColor {
syntax: '<color>';
inherits: true;
initial-value: #DDD;
}
@property --activeTriggerColor {
syntax: '<color>';
inherits: true;
}
:root{
--menuColor : var(--menu-color, #DDD);
--activeTriggerColor : var(--activeTriggerColor);
}
.menu-list {
contain : content;
position : fixed;
z-index : 1000;
top : anchor(bottom);
left : anchor(left);
position-try: flip-inline flip-block;
@@ -18,5 +28,5 @@
}
}
.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
background-color: var(--activeTriggerColor, hsl(from var(--menuColor) h s calc(l * .85))); // tint menu triggers based on menu color
}