/*== ShyFox Polished Menus ========================================================================== Material, colour and state feedback for every popup surface: context menus, the app menu and its subviews, the unified extensions panel, the downloads panel, the identity / permission / protections popups, the bookmarks menus and the notification bar. Density and geometry are not touched. shy-compact.css owns menuitem height, padding and the four-column extensions grid; shy-global.css owns popup placement and the accent variable block. This file only changes what those surfaces are made of. Two facts from the platform drive nearly every rule here: * a popup paints nothing itself. The whole card -- fill, border, radius, shadow -- is drawn by ::part(content), which is the of a `panel` and the .menupopup-arrowscrollbox of a `menupopup`. Both live inside a shadow root, so a plain class selector cannot reach them and ::part() is the only way in. * toolkit's xul.css puts `contain: paint` on menupopup/panel/tooltip, so nothing paints outside the popup widget. The only spare room is --panel-box-shadow-margin (4px), which means --shy-elev-3 reads as a tight edge shadow rather than a wide bloom. Widening that margin also moves the popup and its click-through region on screen, so it is deliberately left alone. ===================================================================================================*/ @media not -moz-pref("shyfox.disable.polish") { /* --- POPUP MATERIAL --------------------------------------------------------------------------------- One card material for menupopup, panel and arrowpanel alike. */ :root { /* the popup card fill. Opaque by default: on a Linux WM without CSD transparency Gecko forces `opacity: 1` and square corners on popups, and a translucent fill there would composite against whatever the opaque widget happens to be. It is upgraded to glass just below. */ --shy-popup-fill: var(--pp-col); /* how long a press reads before it settles */ --shy-dur-press: 90ms; /* separators everywhere in menus and panels; the platform default is 25% of currentColor */ --panel-separator-color: var(--shy-hairline) !important; /* shy-global.css hovers menu items with this variable, but no Gecko version ever defined it, so those rules resolved to `transparent` and context menu items had no hover at all. Give it a value and they come back to life. */ --panel-item-hover-bgcolor: var(--shy-accent-weak); } /* a high-contrast user asked for a visible line, not a hairline */ @media (prefers-contrast) { :root {--panel-separator-color: currentColor !important;} } @media (-moz-gtk-csd-transparency-available), (not (-moz-platform: linux)) { :root {--shy-popup-fill: var(--shy-surface-popup);} } /* interaction tokens, scoped to popups so toolbar buttons elsewhere keep their own states. 155 renamed the whole family: --button-*-menu-* is the new spelling, --button-*-ghost-* the 140 one, and 155 still uses the ghost names for the downloads list. Set both. */ :is(menupopup, panel) { --button-background-color-menu-hover: var(--shy-accent-weak); --button-background-color-menu-active: var(--shy-accent-tint); --button-background-color-ghost-hover: var(--shy-accent-weak); --button-background-color-ghost-active: var(--shy-accent-tint); --button-text-color-menu: var(--bt-col); --button-text-color-menu-hover: var(--bt-col); --button-text-color-menu-active: var(--bt-col); --button-text-color-ghost: var(--bt-col); --button-text-color-ghost-hover: var(--bt-col); --button-text-color-ghost-active: var(--bt-col); /* one source of dimming for disabled items: the token, not a stacked opacity */ --button-text-color-menu-disabled: var(--shy-text-faint); --button-text-color-ghost-disabled: var(--shy-text-faint); --button-background-color-menu-disabled: transparent; --button-background-color-ghost-disabled: transparent; --button-opacity-disabled: 1; /* popup scroll containers. scrollbar-color inherits, so one declaration reaches the arrowscrollbox inside the shadow root as well as .panel-subview-body and every richlistbox. */ scrollbar-color: var(--shy-scrollbar) !important; } /* the platform draws popups natively on Windows (mica) and macOS; reset that before painting our own. macOS is excluded because its native popup also carries the window shadow. */ @media not (-moz-platform: macos) { :is(menupopup, panel):not(#ContentSelectDropdown, #ContentSelectDropdownPopup) { appearance: none !important; background-color: transparent !important; } } /* the card. #ContentSelectDropdown is left alone: it renders a page's