/*== ShyFox Surfaces ================================================================================ Material and motion for the panels ShyFox already positions: the revealed navigation bar, the sidebar and its bookmarks strip, the right-hand tool strip, the menubar, the findbar, the indicator bars of hidden panels, the busy indicators, the status pill, modal dialogs and the page card. Nothing here moves anything. No rule below sets a size, a position, a margin or a padding: every panel keeps the geometry, the 1px border and the --transition timing that shy-navbar.css, shy-sidebar.css, shy-toolbar.css, shy-findbar.css and shy-global.css give it. Only the material changes: * the opaque fill becomes a translucent tint of the same theme colour it already used, * `outline: var(--shadow)` -- ShyFox's faked shadow -- becomes a real layered box-shadow, * the 1px border keeps its width but hands its colour to the first shadow layer, so the hairline fades in with the card instead of snapping on, * a blurred pane is added on a pseudo-element *child*, never on the panel itself. The last point is not a style choice. #urlbar is position:fixed with viewport coordinates, so a backdrop-filter, filter, transform or contain on #nav-bar, #nav-bar-customization-target, #urlbar-container, #navigator-toolbox or #titlebar would make that element the containing block for the address field and drop it back into the toolbar. A pseudo-element is never an ancestor of anything, so it is the only safe host for the blur. Switch the whole layer off with `shyfox.disable.polish`, the blur alone with `shyfox.disable.blur`. ===================================================================================================*/ @media not -moz-pref("shyfox.disable.polish") { /* --- LOCAL TOKENS ----------------------------------------------------------------------------------- Derived from shy-tokens.css. Every rule below is built out of these six and the shared keyframes. */ :root{ /* the single hairline a floating panel gets; private mode keeps its own colour so the window still reads as private at a glance */ --shy-panel-edge: var(--shy-hairline-strong); /* a revealed panel: hairline ring first, then the two elevation layers */ --shy-panel-lift: 0 0 0 1px var(--shy-panel-edge), var(--shy-elev-2); /* the same shadow collapsed to nothing. Declaring it layer-for-layer means the shadow interpolates instead of popping when the panel slides in */ --shy-panel-lift-off: 0 0 0 0 transparent, 0 0 0 0 transparent, 0 0 0 0 transparent; /* indicator bars: an accent-tinted capsule, its resting glow and the bloom it answers with */ --shy-indicator: color-mix(in srgb, var(--shy-color) 40%, var(--bt-col)); --shy-indicator-glow: 0 0 6px color-mix(in srgb, var(--shy-color) 30%, transparent); --shy-indicator-glow-lit: 0 0 14px color-mix(in srgb, var(--shy-color) 65%, transparent); } #main-window[privatebrowsingmode="temporary"]{--shy-panel-edge: var(--private-col);} /* --shy-shimmer sweeps background-position, but every busy gradient ShyFox draws is an !important declaration, and important author declarations outrank animations -- the sweep would never move. Animating the offset as a registered custom property and substituting it into the important declaration keeps the shared -140%..240% travel without fighting the cascade. If @property is ever unavailable the offset stays at its initial value and the sweep is simply invisible. */ @property --shy-sweep { syntax: ""; inherits: false; initial-value: -140%; } @keyframes shy-sweep { from {--shy-sweep: -140%;} to {--shy-sweep: 240%;} } /* --- NAVIGATION BAR --------------------------------------------------------------------------------- */ /* same gate shy-navbar.css uses: navbar hidden or clean mode, and not the customizing page */ #main-window:is([titlepreface*="‌"], [titlepreface*="‍"]):not([customizing]){ /* the card rests flat, so the shadow has somewhere to fade in from */ #nav-bar {box-shadow: var(--shy-panel-lift-off);} /* revealed. shy-navbar.css:274-278 fills the bar with an opaque --tb-col, draws `border: var(--outline)` and fakes a shadow with `outline: var(--shadow)`; all three are replaced here. The border keeps its 1px width -- only its colour goes, because the hairline is now the first layer of the shadow and can fade with the reveal. */ &:has( #nav-bar-customization-target:hover, #nav-bar-customization-target :focus-visible, #nav-bar-customization-target *:not(:is(#unified-extensions-button, #firefox-view-button))[open], #nav-bar-customization-target #searchbar:focus-within, #urlbar:focus-within, #urlbar:is([focused], [open], [breakout-extend]), #nav-bar-overflow-button[open], #nav-bar-overflow-button:hover ){ #nav-bar{ background-color: var(--shy-surface) !important; border-color: transparent !important; outline: none !important; box-shadow: var(--shy-panel-lift) !important; /* Glass pane. #nav-bar::before and ::after are the indicator bar and the tab-load wash, and #nav-bar itself may never carry a backdrop-filter, so the free host is #nav-bar-customization-target::after. That element is statically positioned, so `inset: 0` resolves against #nav-bar's padding box and the pane covers the whole card exactly. */ #nav-bar-customization-target::after{ content: ""; position: absolute; inset: 0; z-index: -1; /* behind the toolbar items, above the panel fill */ pointer-events: none; /* the address field has to stay hit-testable */ border-radius: var(--big-rounding) !important; } } } } /* --- SIDEBAR AND BOOKMARKS -------------------------------------------------------------------------- */ #main-window:is([titlepreface*="᠎"], [titlepreface*="‍"]):not([customizing]){ #sidebar-box, #PersonalToolbar {box-shadow: var(--shy-panel-lift-off);} /* revealed; replaces the fill, border colour and faked shadow at shy-sidebar.css:247-250 */ &:not([titlepreface*="‍"]):has( #sidebar-box:hover, #sidebar-box:focus-within, #PersonalToolbar:hover, #PersonalToolbar *:not(#firefox-view-button)[open], #sidebar-switcher-target[aria-expanded="true"] ){ #sidebar-box, #PersonalToolbar { background-color: var(--shy-surface-deep) !important; border-color: transparent !important; outline: none !important; box-shadow: var(--shy-panel-lift) !important; } /* Of the two panels this rule covers, the bookmarks strip is the one with a spare child to blur through: #PersonalToolbar::before and ::after are both hover targets, but #personal-bookmarks is a static, flex-filling child, so its ::before resolves against the panel's padding box. #sidebar-box gets no pane at all -- see the note below. */ #personal-bookmarks::before{ content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: var(--big-rounding) !important; } } } /* #sidebar-box has no blurred pane on purpose. Both of its pseudo-elements are taken (::before is the hover target, ::after the indicator bar) and its only element child is the that paints the sidebar document opaquely across the whole panel, so there would be nothing behind the pane to blur. It keeps the tint, the hairline and the elevation. */ /* --- RIGHT-HAND TOOL STRIP -------------------------------------------------------------------------- */ #main-window:is([titlepreface*="​"], [titlepreface*="‍"]):not([customizing]){ #TabsToolbar {box-shadow: var(--shy-panel-lift-off);} /* revealed; replaces the fill, border colour and faked shadow at shy-toolbar.css:274-277 */ &:not([titlepreface*="‍"]):has( #TabsToolbar:hover .titlebar-buttonbox-container:not(:hover), #TabsToolbar-customization-target *:not(#firefox-view-button, tab)[open], #TabsToolbar-customization-target #searchbar:focus-within, #TabsToolbar-customization-target :focus-visible, #PanelUI-menu-button:focus-visible, #unified-extensions-button:focus-visible, #PanelUI-menu-button[open], #PanelUI-menu-button:hover, #unified-extensions-button[open], #unified-extensions-button:hover ){ #TabsToolbar{ background-color: var(--shy-surface) !important; border-color: transparent !important; outline: none !important; box-shadow: var(--shy-panel-lift) !important; } /* #TabsToolbar::before and ::after are the hover target and the indicator bar, and the strip itself may not take a backdrop-filter either: the fallback tab bar (#tabbrowser-tabs, shy-sidebar.css:311) is a position:fixed child of it and would be re-anchored. So the pane goes on #TabsToolbar-customization-target::before, pulled up over the padding that reserves room for the menu and extensions buttons so it covers the whole card. */ #TabsToolbar-customization-target::before{ content: ""; position: absolute; inset: calc(-1 * (var(--toolbar-item-hgt) * 2 + 3px)) 0 0 0; z-index: -1; pointer-events: none; border-radius: var(--big-rounding) !important; } } } /* --- MENUBAR ---------------------------------------------------------------------------------------- */ @media not (-moz-platform: macos) { /* the menubar is a floating card too once alt is pressed; shy-global.css:492-495 gives it the same border plus faked shadow, so it gets the same treatment and drops in rather than appearing */ #toolbar-menubar:not([inactive="true"]){ background-color: var(--shy-surface) !important; border-color: transparent !important; outline: none !important; box-shadow: var(--shy-panel-lift) !important; /* fade, not drop: shy-drop-in sets `translate`, and shy-controls.css hosts the position:fixed window-control buttonbox inside this element, which a translated ancestor would re-anchor. */ animation: shy-fade-in var(--shy-dur) var(--shy-ease) !important; /* the menubar clips to its own box (overflow: clip, shy-global.css:473), so the pane can never escape the rounded corners */ &::before{ content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: var(--rounding) !important; } } } /* --- FINDBAR ---------------------------------------------------------------------------------------- */ findbar{ background-color: var(--shy-surface) !important; border-color: transparent !important; outline: none !important; box-shadow: var(--shy-panel-lift) !important; /* both of the findbar's own pseudo-elements are free */ &::before{ content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: var(--big-rounding) !important; } } /* the findbar is never display:none -- it slides out below the window edge -- so its shadow is collapsed rather than removed, and grows back as the bar comes up */ findbar[hidden] {box-shadow: var(--shy-panel-lift-off);} /* --- HIDDEN PANEL INDICATORS ------------------------------------------------------------------------ The three capsules that mark where a hidden panel lives. --hide-bar-opct still owns their visibility: shy-variables.css:122-124 forces it to 0 in clean mode and fullscreen with !important, and nothing here touches opacity, so that contract is intact. */ #main-window:is([titlepreface*="‌"], [titlepreface*="‍"]):not([customizing]) #nav-bar::before, #main-window:is([titlepreface*="​"], [titlepreface*="‍"]):not([customizing]) #TabsToolbar::after, #main-window:is([titlepreface*="᠎"], [titlepreface*="‍"]):not([customizing]) #sidebar-box::after { background-color: var(--shy-indicator) !important; box-shadow: var(--shy-indicator-glow) !important; /* keep ShyFox's own transition (it carries the opacity fade and the position of the capsule) and re-time the two properties this file animates. A duplicated property takes its last entry. */ transition: var(--transition), box-shadow var(--shy-dur-fast) var(--shy-ease), scale var(--shy-dur-fast) var(--shy-ease) !important; } /* Entering a panel's hover hitbox is what reveals it, so the capsule answers the approach by blooming across its short axis as the panel slides out from behind it: it grows and its glow widens over 110ms while the reveal fades it out over --trans-dur. */ #main-window:is([titlepreface*="‌"], [titlepreface*="‍"]):not([customizing]) #nav-bar:hover::before{ scale: 1 1.5; box-shadow: var(--shy-indicator-glow-lit) !important; } #main-window:is([titlepreface*="​"], [titlepreface*="‍"]):not([customizing]) #TabsToolbar:hover::after, #main-window:is([titlepreface*="᠎"], [titlepreface*="‍"]):not([customizing]) #sidebar-box:hover::after { scale: 1.5 1; box-shadow: var(--shy-indicator-glow-lit) !important; } /* --- BUSY AND PROGRESS ------------------------------------------------------------------------------ The load and download indicators keep the geometry and the fill percentage ShyFox computes; they gain the accent glow and a slow sweep. The second background layer is exactly as wide (or tall) as the bar, and a percentage background-position of a full-size layer resolves to a zero offset, so only the sweep moves. The percentages carry a 0% fallback: --shy-download-pcent comes from a table of :has() rules in shy-variables.css that only covers whole percents, and an unresolved var would take the whole declaration down with it and leave the bar blank. */ /* current tab loading, in the navbar capsule (shy-navbar.css:212-218) */ #main-window:is([titlepreface*="‌"], [titlepreface*="‍"]):not([customizing]):has(.tabbrowser-tab[selected][busy]) #nav-bar::before{ background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bt-col) 55%, transparent), transparent), linear-gradient(to right, var(--shy-color) 0 var(--shy-tab-load-pcent, 0%), var(--shy-text-faint) var(--shy-tab-load-pcent, 0%) 100%) !important; background-size: 45% 100%, 100% 100% !important; background-repeat: no-repeat !important; background-position: var(--shy-sweep) 0, 0 0 !important; box-shadow: var(--shy-indicator-glow-lit) !important; animation: shy-sweep 2.4s var(--shy-ease-in-out) infinite !important; } /* the same load state on the address field (shy-navbar.css:67-73). The sweep is deliberately much fainter here: it passes behind the URL. */ #main-window:not([customizing]):not([titlepreface*="‌"]):has(.tabbrowser-tab[selected][busy]) #urlbar:not(:is([focused], [open], [breakout-extend])) :is(#urlbar-background, .urlbar-background){ background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bt-col) 9%, transparent), transparent), linear-gradient(to right, color-mix(in srgb, var(--shy-color) 16%, transparent) 0 var(--shy-tab-load-pcent, 0%), color-mix(in srgb, var(--bt-col) 8%, transparent) var(--shy-tab-load-pcent, 0%) 100%) !important; background-size: 35% 100%, 100% 100% !important; background-repeat: no-repeat !important; background-position: var(--shy-sweep) 0, 0 0 !important; box-shadow: inset 0 0 0 1px var(--shy-accent-weak) !important; animation: shy-sweep 2.4s var(--shy-ease-in-out) infinite !important; } /* download progress, on the tool strip capsule (shy-toolbar.css:288-297). The strip is vertical, so the same offset drives the Y axis instead. */ #main-window:is([titlepreface*="​"], [titlepreface*="‍"]):not([customizing]):has(#downloads-button[progress="true"]) #TabsToolbar::after{ background-image: linear-gradient(180deg, transparent, color-mix(in srgb, var(--bt-col) 55%, transparent), transparent), linear-gradient(to top, var(--shy-color) 0 var(--shy-download-pcent, 0%), var(--shy-text-faint) var(--shy-download-pcent, 0%) 100%) !important; background-size: 100% 45%, 100% 100% !important; background-repeat: no-repeat !important; background-position: 0 var(--shy-sweep), 0 0 !important; box-shadow: var(--shy-indicator-glow-lit) !important; animation: shy-sweep 2.4s var(--shy-ease-in-out) infinite !important; } /* --- STATUS PILL ------------------------------------------------------------------------------------ The link target at the bottom of the window (shy-global.css:131-140) */ #statuspanel #statuspanel-label{ background-color: var(--shy-surface) !important; border-color: transparent !important; outline: none !important; box-shadow: var(--shy-panel-lift) !important; } /* the pill is created once and reused, so the fade has to be driven by the attribute the browser toggles when a link is hovered */ #statuspanel:not([inactive]) #statuspanel-label{ animation: shy-fade-in var(--shy-dur) var(--shy-ease) !important; } /* --- MODAL DIALOGS ---------------------------------------------------------------------------------- */ /* real elevation for the dialog card (shy-global.css:185-189 gives it only a border), and a settle rather than a hard cut. .dialogBox already carries `will-change: transform`, so it is its own containing block and the scale costs nothing new. */ .dialogBox{ box-shadow: var(--shy-elev-3) !important; animation: shy-pop-in var(--shy-dur) var(--shy-ease) !important; } /* The tab-modal scrim. ShyFox clears the platform overlay colour on .dialogTemplate, and the fixed pseudo it draws instead is anchored and clipped by .dialogBox's own will-change, so the page behind a tab-modal dialog is currently not dimmed at all. Dim it from the theme and blur it. */ .dialogStack > .dialogTemplate.dialogOverlay[topmost="true"]{ background-color: color-mix(in srgb, var(--bg-col) 45%, transparent) !important; animation: shy-fade-in var(--shy-dur) var(--shy-ease) !important; } /* window-modal dialogs dim through the real top-layer backdrop, which still uses the platform overlay colour */ #window-modal-dialog::backdrop{ background-color: color-mix(in srgb, var(--bg-col) 55%, transparent) !important; } /* --- BROWSER CHROME SCROLLBARS ---------------------------------------------------------------------- Chrome scroll containers only. userChrome.css cannot reach a web page at all, and the sidebar and dialog frames are separate documents, so nothing here can touch a page scrollbar. shy-menus.css already inherits the colour into popups; this adds the width, and the scrollers that sit outside a popup. */ arrowscrollbox, menupopup::part(arrowscrollbox-scrollbox), panelview, .panel-subview-body, richlistbox, tree, .urlbarView, #downloadsListBox, #widget-overflow-scroller, #customization-palette-container { scrollbar-width: thin; scrollbar-color: var(--shy-scrollbar) !important; } /* --- WINDOW CONTENT FRAME --------------------------------------------------------------------------- */ /* The page card already has its rounded corners and its 1px border (shy-global.css:46-63). This adds the outer hairline and the soft shadow that lift it off the coloured field. Both paint outside the border box, so the card does not move and does not change size; in fullscreen the margins are zero and the shadow simply falls outside the viewport. */ #browser #tabbrowser-tabbox{ box-shadow: 0 0 0 1px var(--shy-hairline), var(--shy-elev-2) !important; } /* --- BACKDROP BLUR ---------------------------------------------------------------------------------- Every backdrop-filter in this file, in one place. Each host is either a pseudo-element that only exists while its panel is revealed, or an element that is display:none until it is needed, so this costs nothing while the chrome is idle -- and never more than three blurred surfaces at once. */ @media not -moz-pref("shyfox.disable.blur") { #nav-bar-customization-target::after, #TabsToolbar-customization-target::before, #personal-bookmarks::before, #toolbar-menubar::before, findbar::before, #statuspanel-label, .dialogStack > .dialogTemplate.dialogOverlay[topmost="true"], #window-modal-dialog::backdrop { backdrop-filter: blur(var(--shy-glass-blur)) saturate(var(--shy-glass-saturate)) !important; } } /* --- GRACEFUL DEGRADATION --------------------------------------------------------------------------- This file is imported after shy-compat.css, so it restates both contracts rather than inheriting them. */ @media (prefers-reduced-motion: reduce) { /* Restated at the specificity of the rules they undo. Among !important author declarations specificity decides, so the bare selectors below are not enough on their own for the busy sweeps, the menubar, the status pill or the dialog scrim. */ #main-window:is([titlepreface*="‌"], [titlepreface*="‍"]):not([customizing]):has(.tabbrowser-tab[selected][busy]) #nav-bar::before, #main-window:not([customizing]):not([titlepreface*="‌"]):has(.tabbrowser-tab[selected][busy]) #urlbar:not(:is([focused], [open], [breakout-extend])) :is(#urlbar-background, .urlbar-background), #main-window:is([titlepreface*="​"], [titlepreface*="‍"]):not([customizing]):has(#downloads-button[progress="true"]) #TabsToolbar::after, #toolbar-menubar:not([inactive="true"]), #statuspanel:not([inactive]) #statuspanel-label, .dialogStack > .dialogTemplate.dialogOverlay[topmost="true"], .dialogBox { animation: none !important; transition: none !important; scale: none !important; translate: none !important; } #nav-bar::before, #TabsToolbar::after, #sidebar-box::after, #urlbar :is(#urlbar-background, .urlbar-background), #toolbar-menubar, #statuspanel-label, .dialogBox, .dialogStack > .dialogTemplate.dialogOverlay[topmost="true"] { animation: none !important; transition: none !important; scale: none !important; translate: none !important; } } @media (forced-colors: active) { #nav-bar, #TabsToolbar, #sidebar-box, #PersonalToolbar, #toolbar-menubar, findbar, #statuspanel-label, .dialogBox, #browser #tabbrowser-tabbox { background-color: Canvas !important; border-color: CanvasText !important; /* the hairline goes back on the real border */ box-shadow: none !important; } /* no translucency and no blur: the panes would only wash out system colours */ #nav-bar-customization-target::after, #TabsToolbar-customization-target::before, #personal-bookmarks::before, #toolbar-menubar::before, findbar::before { display: none !important; } #statuspanel-label, .dialogStack > .dialogTemplate.dialogOverlay[topmost="true"], #window-modal-dialog::backdrop { backdrop-filter: none !important; } #nav-bar::before, #TabsToolbar::after, #sidebar-box::after { background-image: none !important; background-color: CanvasText !important; box-shadow: none !important; scale: none !important; animation: none !important; } } } /* shyfox.disable.polish */