repositories

NixDaemon

NixOS pentest workstation as one flake — IceBreaker's successor

clonegit clone https://git.daemon-sec.xyz/NixDaemon.git
shy-menus.cssCSS502 lines21.7 KiBraw download
/*== 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 <html:slot> 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 <select> and carries per-option
   colours from content, so a theme text colour there can make options unreadable. */
:is(menupopup, panel):not(#ContentSelectDropdown, #ContentSelectDropdownPopup)::part(content) {
  background: var(--shy-popup-fill) !important;
  color: var(--bt-col) !important;
  border: 1px solid var(--shy-hairline) !important;
  box-shadow: var(--shy-elev-3) !important;
}

/* Blur goes on ::part(content) rather than the popup, which keeps it off every ancestor of the
   floating #urlbar. It is decoration only -- a chrome backdrop-filter can silently no-op, so
   --shy-popup-fill stays opaque enough to carry the surface by itself. */
@media not -moz-pref("shyfox.disable.blur") {
  @media (-moz-gtk-csd-transparency-available), (not (-moz-platform: linux)) {
    :is(menupopup, panel):not(#ContentSelectDropdown, #ContentSelectDropdownPopup)::part(content) {
      backdrop-filter: blur(var(--shy-glass-blur)) saturate(var(--shy-glass-saturate)) !important;
    }
  }
}

/* Entrance. The widget itself cannot be animated reliably -- Gecko sizes the popup window before the
   animation runs, so a scale on the popup leaves the shadow and hit region at the old size, and
   `@media not (-moz-panel-animations)` disables the platform's own translate on several Linux WMs.
   Animating ::part(content) instead is safe: shy-pop-in only ever scales below 1, so it never grows
   past the `overflow: clip` on that box. */
:is(menupopup, panel):not(#ContentSelectDropdown, #ContentSelectDropdownPopup)::part(content) {
  animation: shy-pop-in var(--shy-dur) var(--shy-ease) !important;
}

/*
--- MENU ITEMS -------------------------------------------------------------------------------------

[_moz-menuactive] is what Gecko sets for both pointer hover and keyboard navigation on a menuitem --
:hover is not used there -- and it is spelled the same in 140 and 155, so one hook covers both states
on both versions. The same is true of [disabled] and [checked], which 140 writes as ="true".

*/

#main-window menupopup > :is(menuitem, menu) {
  transition:
    background-color var(--shy-dur-fast) var(--shy-ease),
    box-shadow var(--shy-dur-fast) var(--shy-ease),
    color var(--shy-dur-fast) var(--shy-ease);
}

/* hover / keyboard highlight. Specificity 1-2-2 so it outranks the 1-1-1 rules in the CONTEXT MENU
   section of shy-global.css, which this supersedes. */
#main-window menupopup > :is(menuitem, menu):not([disabled])[_moz-menuactive] {
  background-color: var(--shy-accent-weak) !important;
  color: var(--bt-col) !important;
}

/* press: a touch more accent, and quick enough to read as a response rather than a transition */
#main-window menupopup > :is(menuitem, menu):not([disabled])[_moz-menuactive]:active {
  background-color: var(--shy-accent-tint) !important;
  transition-duration: var(--shy-dur-press);
}

/* checked items keep a tint and colour the native check itself. On Linux .menu-icon is a real
   checkbox widget, which accent-color drives; on Windows it is menu-check.svg, which fill drives. */
#main-window menupopup > menuitem[checked] {
  background-color: var(--shy-accent-weak) !important;
  accent-color: var(--shy-color);
}

#main-window menupopup > menuitem[checked] > .menu-icon {
  fill: var(--shy-color) !important;
  fill-opacity: 1 !important;
}

/* disabled: one dim, no hover feedback. The platform still paints -moz-menuhoverdisabled when the
   keyboard lands on a disabled item, so the transparent fill has to be stated. */
#main-window menupopup > :is(menuitem, menu)[disabled] {
  color: var(--shy-text-faint) !important;
  background-color: transparent !important;
}

/* the accel text ("Ctrl+T") is already quieter than the label; keep it in the same family */
#main-window menupopup > :is(menuitem, menu):not([disabled]) > .menu-accel {
  color: var(--shy-text-dim) !important;
}

/* the submenu arrow is a hint, not a label. 140 drives it from --menu-icon-opacity and 155 from
   --menu-arrow-opacity, so the property is set directly rather than through either name. */
#main-window menupopup > menu::after {
  fill-opacity: 0.55 !important;
}

/*
--- APP MENU AND SUBVIEWS --------------------------------------------------------------------------

Everything in a panelview is a .subviewbutton, so the token block above already gives it the same
hover, press and disabled treatment as a menu item. What is left is the checked state, focus, and the
seams between sections.

*/

/* panel buttons cannot show a checkbox, so a checked one gets a leading accent edge. An inset shadow
   draws it without a pseudo-element and without moving anything -- .subviewbutton::before is already
   spoken for by several icon rules in shy-icons.css. */
#main-window panel .subviewbutton[checked] {
  background-color: var(--shy-accent-weak) !important;
  box-shadow: inset 3px 0 0 var(--shy-accent-line) !important;
}

/* keyboard focus reads like hover plus the accent ring the rest of the theme uses */
#main-window panel :is(.subviewbutton, .panel-info-button, .panel-subview-footer-button):focus-visible {
  background-color: var(--shy-accent-weak) !important;
  outline: 2px solid var(--shy-accent-line) !important;
  outline-offset: -2px !important;
}

/* The footer is a section of the same card, not a bar sitting on it. Every .panel-header,
   #downloadsFooter and #protections-popup-footer in browser.xhtml already has a toolbarseparator
   against it, and those are hairlines now, so only .panel-footer -- a moz-button-group with no
   separator of its own -- needs a seam drawn. It is drawn inset so nothing shifts by a pixel. */
#main-window panel .panel-footer {
  background-color: transparent !important;
  box-shadow: inset 0 1px 0 var(--shy-hairline) !important;
}

#main-window panel .panel-subview-footer-button {
  border-radius: var(--rounding) !important;
  transition: background-color var(--shy-dur-fast) var(--shy-ease) !important;
}

/* the update banner is the one item in the app menu that is asking for attention */
#main-window panel .panel-banner-item {
  --panel-banner-item-background-color: var(--shy-accent-weak);
  --panel-banner-item-hover-bgcolor:    var(--shy-accent-tint);
  --panel-banner-item-active-bgcolor:   var(--shy-accent-strong);
  --panel-banner-item-color:            var(--bt-col);
}

/* Icon tinting is already currentColor everywhere (shy-icons.css), which means a disabled item's
   icon fades with its label for free now that --button-text-color-*-disabled carries the dimming.
   The one thing missing is the other end: shy-icons.css holds every panel icon at the platform's
   reduced fill-opacity, so a highlighted or checked row had a full-strength label next to a faded
   icon. Bring the icon up with the row. */
#main-window panel .subviewbutton:is(:hover, [checked]):not([disabled]) > image {
  fill-opacity: 1 !important;
}

/*
--- UNIFIED EXTENSIONS -----------------------------------------------------------------------------

shy-compact.css packs this panel into a four-column icon grid and hides the labels, so each cell is a
bare icon that needs its own hit area. Geometry stays exactly where that file put it.

*/

#unified-extensions-panel .unified-extensions-item-action-button.subviewbutton {
  border-radius: var(--rounding) !important;
  transition:
    background-color var(--shy-dur-fast) var(--shy-ease),
    scale var(--shy-dur-press) var(--shy-ease);
}

#unified-extensions-panel .unified-extensions-item-action-button.subviewbutton:not([disabled]):hover {
  background-color: var(--shy-accent-weak) !important;
}

/* pressed. A scale on a panel button is safe -- it is nowhere near an ancestor of #urlbar -- and it
   is the one property that reads as "pressed" without moving the grid. */
#unified-extensions-panel .unified-extensions-item-action-button.subviewbutton:not([disabled]):hover:active {
  background-color: var(--shy-accent-tint) !important;
  scale: 0.94;
}

/* an extension wanting attention already draws an accent dot (shy-global.css pins
   --uei-button-attention-dot-color to the accent); back it with a tint so the cell reads at a glance */
#unified-extensions-panel .unified-extensions-item[attention] > .unified-extensions-item-row-wrapper > .unified-extensions-item-action-button.subviewbutton {
  background-color: var(--shy-accent-weak) !important;
}

/*
--- DOWNLOADS --------------------------------------------------------------------------------------

*/

#downloadsPanel {
  --download-progress-fill-color: var(--shy-color) !important;
  --download-progress-paused-color: var(--shy-text-faint) !important;
  /* the platform flare is a hardcoded 75% white, which fights any theme */
  --download-progress-flare-color: color-mix(in srgb, var(--bt-col) 55%, transparent) !important;
}

#downloadsPanel #downloadsListBox > richlistitem {
  transition: background-color var(--shy-dur-fast) var(--shy-ease) !important;
}

/* the track is the same hairline used for every other seam in the theme */
#downloadsPanel .downloadProgress {
  background-color: var(--shy-hairline) !important;
}

/* the filled part carries the same accent glow the theme uses on focused surfaces */
#downloadsPanel .downloadProgress::-moz-progress-bar {
  box-shadow: 0 0 8px color-mix(in srgb, var(--shy-color) 45%, transparent) !important;
}

#downloadsPanel .downloadProgress[paused]::-moz-progress-bar {
  box-shadow: none !important;
}

/* cancel / retry / show-in-folder */
#downloadsPanel .downloadButton {
  transition:
    background-color var(--shy-dur-fast) var(--shy-ease),
    scale var(--shy-dur-press) var(--shy-ease);
}

#downloadsPanel .downloadButton:hover:active {
  scale: 0.92;
}

#downloadsPanel .downloadsPanelFooterButton {
  border-radius: var(--rounding) !important;
  transition: background-color var(--shy-dur-fast) var(--shy-ease) !important;
}

/* the summary strip sits inside the card, so it takes a tint rather than its own dimmed panel fill */
#downloadsPanel #downloadsSummary {
  background-color: var(--shy-hover-tint) !important;
  border-radius: var(--rounding) !important;
}

/*
--- SITE INFORMATION POPUPS ------------------------------------------------------------------------

The identity, permission, trust and protections popups. Their card material comes from the shared
::part(content) rule; the rows inside them are .subviewbutton, so they already match the app menu.
These rules cover the pieces that are not buttons.

*/

/* a permission row is not focusable but it does hold a remove button, so it gets a row highlight */
#main-window :is(#identity-popup, #permission-popup) .permission-popup-permission-item {
  border-radius: var(--rounding) !important;
  transition: background-color var(--shy-dur-fast) var(--shy-ease) !important;
}

#main-window :is(#identity-popup, #permission-popup) .permission-popup-permission-item:hover {
  background-color: var(--shy-hover-tint) !important;
}

/* the connection summary is the popup's headline; keep it on the theme text colour and let the
   platform's per-state icon carry the meaning */
#main-window .site-information-popup .identity-popup-security-connection,
#main-window #identity-popup .identity-popup-security-connection {
  color: var(--bt-col) !important;
}

/* an enabled protection category reads as active, without an accent fill behind its label */
#main-window #protections-popup .protections-popup-category:not([uidisabled], [disabled]) {
  transition: background-color var(--shy-dur-fast) var(--shy-ease) !important;
}

#main-window #protections-popup .protections-popup-category[uidisabled] {
  color: var(--shy-text-faint) !important;
}

/* the "blocked this week" counter is a number worth highlighting; the footer icons stay neutral */
#main-window #protections-popup #protections-popup-trackers-blocked-counter-description {
  color: var(--shy-color) !important;
}

/*
--- NOTIFICATION BAR -------------------------------------------------------------------------------

shy-global.css already floats this as a card at the top of the content area. notification-message is a
moz-message-bar, whose entire inside is shadow DOM driven by inherited --message-bar-* properties, so
those tokens are the only way in -- and the only way the close button in the shadow root gets the
theme's text colour.

*/

#main-window :is(#tab-notification-deck, .global-notificationbox) notification-message {
  --message-bar-border-color: var(--shy-hairline);
  --message-bar-text-color: var(--bt-col);
  --message-bar-icon-background-color: transparent;
  --message-bar-border-radius: var(--big-rounding);

  background-color: var(--shy-surface) !important;
  box-shadow: var(--shy-elev-2) !important;
  animation: shy-drop-in var(--shy-dur) var(--shy-ease) !important;
}

/* The accent icon is for ordinary notices only. moz-message-bar sets --message-bar-icon-color per
   severity inside its shadow root, and an outer declaration would win against all of them, so the
   warning / success / error bars are excluded and keep their semantic icon colour -- which, since
   the card fill above is now uniform, is the only severity cue left. */
#main-window :is(#tab-notification-deck, .global-notificationbox)
  notification-message:not([type="warning"], [type="success"], [type="error"], [type="critical"]) {
  --message-bar-icon-color: var(--shy-color);
}

@media not -moz-pref("shyfox.disable.blur") {
  #main-window :is(#tab-notification-deck, .global-notificationbox) notification-message {
    backdrop-filter: blur(var(--shy-glass-blur)) saturate(var(--shy-glass-saturate)) !important;
  }
}

/* the infobar's buttons are XUL buttons in the light tree, so they can take the popup states */
#main-window :is(#tab-notification-deck, .global-notificationbox) .notification-button {
  --button-background-color-hover:  var(--shy-accent-weak);
  --button-background-color-active: var(--shy-accent-tint);
  border-radius: var(--rounding) !important;
  transition: background-color var(--shy-dur-fast) var(--shy-ease) !important;
}

#main-window :is(#tab-notification-deck, .global-notificationbox) .notification-button:focus-visible {
  outline: 2px solid var(--shy-accent-line) !important;
  outline-offset: 1px !important;
}

/*
--- GRACEFUL DEGRADATION ---------------------------------------------------------------------------

This file is imported after shy-compat.css, so it has to restate both contracts rather than inherit
them.

*/

@media (prefers-reduced-motion: reduce) {
  :root {--shy-dur-press: 0s;}

  :is(menupopup, panel)::part(content),
  #main-window menupopup > :is(menuitem, menu),
  #main-window panel .panel-subview-footer-button,
  #unified-extensions-panel .unified-extensions-item-action-button.subviewbutton,
  #downloadsPanel :is(#downloadsListBox > richlistitem, .downloadButton, .downloadsPanelFooterButton),
  #main-window :is(#identity-popup, #permission-popup) .permission-popup-permission-item,
  #main-window #protections-popup .protections-popup-category,
  #main-window :is(#tab-notification-deck, .global-notificationbox) notification-message,
  #main-window :is(#tab-notification-deck, .global-notificationbox) .notification-button {
    animation: none !important;
    transition: none !important;
  }

  /* the pressed states stay, they just arrive instantly */
  #unified-extensions-panel .unified-extensions-item-action-button.subviewbutton:not([disabled]):hover:active,
  #downloadsPanel .downloadButton:hover:active {
    scale: 1;
  }
}

@media (forced-colors: active) {
  :root {
    --shy-popup-fill: Canvas;
    --panel-separator-color: CanvasText !important;
    --panel-item-hover-bgcolor: Highlight;
  }

  :is(menupopup, panel)::part(content) {
    background: Canvas !important;
    color: CanvasText !important;
    border: 1px solid CanvasText !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    animation: none !important;
  }

  /* Highlight / HighlightText is the one pair the system guarantees is legible together */
  #main-window menupopup > :is(menuitem, menu):not([disabled])[_moz-menuactive],
  #main-window menupopup > :is(menuitem, menu):not([disabled])[_moz-menuactive]:active,
  #main-window menupopup > menuitem[checked],
  #main-window panel .subviewbutton[checked],
  #unified-extensions-panel .unified-extensions-item-action-button.subviewbutton:not([disabled]):hover {
    background-color: Highlight !important;
    color: HighlightText !important;
    box-shadow: none !important;
  }

  #main-window menupopup > :is(menuitem, menu)[disabled],
  #main-window #protections-popup .protections-popup-category[uidisabled] {
    color: GrayText !important;
  }

  #main-window panel .panel-footer {
    box-shadow: inset 0 1px 0 CanvasText !important;
  }

  #main-window :is(#tab-notification-deck, .global-notificationbox) notification-message {
    --message-bar-background-color: Canvas;
    --message-bar-border-color: CanvasText;
    --message-bar-text-color: CanvasText;
    --message-bar-icon-color: CanvasText;

    background-color: Canvas !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    animation: none !important;
  }

  #downloadsPanel .downloadProgress::-moz-progress-bar {
    box-shadow: none !important;
  }

  #downloadsPanel #downloadsSummary {
    background-color: Canvas !important;
    box-shadow: inset 0 0 0 1px CanvasText !important;
  }
}

} /* shyfox.disable.polish */