/*== ShyFox Urlbar Polish ===========================================================================
Material, state feedback and motion for the address bar, the floating search overlay and the results
list. Position and geometry stay where shy-floating-search.css and shy-navbar.css put them -- this
file only paints.
Two constraints shape everything below.
1. #urlbar is position:fixed against the viewport, so nothing here may put filter, backdrop-filter,
transform, translate, perspective, contain or will-change on #nav-bar, #nav-bar-customization-
target, #urlbar-container, #navigator-toolbox or #urlbar itself: any of those would make the
ancestor the containing block and collapse the floating field back into the toolbar. The blur
therefore lives on :is(#urlbar-background, .urlbar-background), which is an absolutely
positioned *child* of #urlbar and a sibling of the input container and the results view, so it
captures nothing.
2. --shy-color is chosen by the user and its luminance is unknown. Nothing here puts --bt-col text
on a solid accent fill: selection is an --shy-accent-tint plus a solid accent bar off to the
side, where no text sits on top of it.
Gecko 155 turned most of the urlbar internals from ids into classes, so every selector is written
:is(#old, .new) or against the class both builds share.
===================================================================================================*/
@media not -moz-pref("shyfox.disable.polish") {
/*== TOKENS =========================================================================================
Local additions to shy-tokens.css. Everything is a mix of the colours ShyFox already reads off the
active theme, so a personal palette keeps full control.
*/
:root {
/* the field reads as recessed when idle and one step back towards the toolbar on hover */
--shy-field-idle: color-mix(in srgb, var(--bg-col) 55%, var(--tb-col));
--shy-field-hover: color-mix(in srgb, var(--bg-col) 32%, var(--tb-col));
/* entrance of the floating overlay. The smoke test measures the field's rectangle about a tenth
of a second after focus, so this has to be all but over by then. */
--shy-urlbar-enter: 150ms;
/* press feedback, shorter than --shy-dur-fast so a click reads as immediate */
--shy-dur-press: 90ms;
/* how much of the page the scrim behind the overlay keeps */
--shy-scrim-opct: 66%;
}
/* with blur on, the scrim does not have to work as hard to separate the overlay from the page */
@media not -moz-pref("shyfox.disable.blur") {
:root {--shy-scrim-opct: 46%;}
}
/*== THE FIELD ======================================================================================
The painted surface of the address bar is #urlbar-background (140) / .urlbar-background (155): an
empty box with position:absolute and inset:0, drawn behind the input container and the results view.
It is the only safe host for material on this widget.
*/
/* one hairline and one transition for every state below */
#main-window:not([customizing]) #urlbar :is(#urlbar-background, .urlbar-background) {
border: 1px solid var(--shy-hairline) !important;
transition:
background-color var(--shy-dur-fast) var(--shy-ease),
border-color var(--shy-dur-fast) var(--shy-ease),
outline-color var(--shy-dur-fast) var(--shy-ease),
box-shadow var(--shy-dur) var(--shy-ease) !important;
}
/* idle: a quiet sunken fill. In the hidden-navbar state the whole bar is invisible until it is
revealed, so this must never draw attention on its own. The tab-loading gradient in
shy-navbar.css:67 is written at a much higher specificity and still wins over both of these. */
#main-window:not([customizing]) #urlbar:not(:is([focused], :focus-within, [open], [breakout-extend]))
:is(#urlbar-background, .urlbar-background) {
background-color: var(--shy-field-idle) !important;
}
/* hover: barely there -- one step less sunken and a slightly firmer edge */
#main-window:not([customizing]) #urlbar:not(:is([focused], :focus-within, [open], [breakout-extend])):hover
:is(#urlbar-background, .urlbar-background) {
background-color: var(--shy-field-hover) !important;
border-color: var(--shy-hairline-strong) !important;
}
/* focus: the field lifts and the accent arrives as a hairline plus its glow, never as a fill.
--shy-accent-glow already carries the 1px ring, so the border stays out of the way. Replaces
140's hard-coded `box-shadow: 0 1px 3px rgba(0,0,0,0.23)` and the platform focus outline. */
#main-window:not([customizing]) #urlbar:is([focused], :focus-within, [open], [breakout-extend])
:is(#urlbar-background, .urlbar-background) {
background-color: var(--shy-surface-raised) !important;
border-color: transparent !important;
outline: none !important;
box-shadow: var(--shy-accent-glow) !important;
}
/* the caret is a rule, not text, so the solid accent is safe here */
#main-window #urlbar:is([focused], [open]) :is(#urlbar-input, .urlbar-input) {
caret-color: var(--shy-color);
}
/* shy-global.css:585 paints every ::selection with the solid accent. Inside the field that is
--bt-col text on an unknown-luminance fill, so tint instead and pin the text colour. */
#main-window #urlbar :is(#urlbar-input, .urlbar-input)::selection {
background-color: var(--shy-accent-strong) !important;
color: var(--bt-col) !important;
}
/* the placeholder is secondary text; Firefox dims it with opacity, which also dims the caret hint */
#main-window #urlbar :is(#urlbar-input, .urlbar-input)::placeholder {
color: var(--shy-text-dim) !important;
opacity: 1 !important;
}
/*== CONTROLS INSIDE THE FIELD ======================================================================
The go button, the page-action buttons and the identity chips all read one family of tokens, which
Gecko 155 renamed wholesale. Setting both spellings on #urlbar retunes every one of them at once.
*/
#main-window:not([customizing]) #urlbar {
--urlbar-box-hover-bgcolor: var(--shy-hover-tint) !important;
--urlbar-box-background-color-hover: var(--shy-hover-tint) !important;
--urlbar-box-active-bgcolor: var(--shy-active-tint) !important;
--urlbar-box-background-color-active: var(--shy-active-tint) !important;
}
/* quick in, quicker down */
#main-window #urlbar :is(#urlbar-go-button, .urlbar-go-button, .urlbar-page-action,
#urlbar-revert-button-container) {
transition: background-color var(--shy-dur-fast) var(--shy-ease) !important;
&:hover:active {
transition-duration: var(--shy-dur-press);
}
}
/*== CHIPS ==========================================================================================
Search mode and switch-to-tab are the two states where the field says something about itself. Both
get the accent as a tint plus one hairline, and keep --bt-col text.
*/
/* shy-compat.css pins --urlbar-box-background-color at :root with !important, so this needs
!important as well as the higher specificity to land. */
#main-window:not([customizing]) #urlbar[searchmode] {
--urlbar-box-bgcolor: var(--shy-accent-tint) !important;
--urlbar-box-focus-bgcolor: var(--shy-accent-tint) !important;
--urlbar-box-background-color: var(--shy-accent-tint) !important;
--urlbar-box-background-color-focus: var(--shy-accent-tint) !important;
}
/* inset shadow rather than a border so the chip does not change size */
#main-window #urlbar[searchmode]
:is(#urlbar-search-mode-indicator, #searchmode-switcher-chicklet) {
box-shadow: inset 0 0 0 1px var(--shy-accent-line) !important;
color: var(--bt-col) !important;
}
/* 155 turned the switcher into a shadow-DOM moz-button; its painted box is only reachable as a
part. Inert on 140, where the switcher is a plain toolbarbutton handled by the rule above. */
#main-window #urlbar[searchmode] .searchmode-switcher::part(button) {
box-shadow: inset 0 0 0 1px var(--shy-accent-line) !important;
}
/* the "Switch to Tab" / extension chip inside the field */
#main-window #urlbar > :is(#urlbar-input-container, .urlbar-input-container) > #urlbar-label-box {
background-color: var(--shy-accent-tint) !important;
color: var(--bt-col) !important;
box-shadow: inset 0 0 0 1px var(--shy-accent-line) !important;
border-radius: var(--rounding) !important;
}
/* and the matching chiclet on the result row it points at */
.urlbarView .urlbarView-row[has-action]:is([type="switchtab"], [type="remotetab"], [type="clipboard"])
.urlbarView-action {
background-color: var(--shy-accent-tint) !important;
color: var(--bt-col) !important;
box-shadow: inset 0 0 0 1px var(--shy-accent-line) !important;
}
/*== RESULTS ========================================================================================
One variable block retunes hover, selection, separators and secondary text for the whole list, in
both builds: Gecko 155 lower-cased every one of these token names but kept the same meanings.
Declaring them on .urlbarView beats the :root defaults by proximity, whatever their specificity.
*/
.urlbarView {
--urlbarView-hover-background: var(--shy-hover-tint);
--urlbarview-background-color-hover: var(--shy-hover-tint);
--urlbarView-highlight-background: var(--shy-accent-tint);
--urlbarview-background-color-selected: var(--shy-accent-tint);
--urlbarView-highlight-color: var(--bt-col);
--urlbarview-text-color-selected: var(--bt-col);
--urlbarView-separator-color: var(--shy-hairline);
--urlbarview-separator-color: var(--shy-hairline);
--urlbarView-secondary-text-color: var(--shy-text-dim);
--urlbarview-text-color-secondary: var(--shy-text-dim);
--urlbarView-action-color: var(--shy-text-dim);
--urlbarview-text-color-action: var(--shy-text-dim);
--urlbarView-action-button-background-color: var(--shy-hover-tint);
--urlbarView-action-button-hover-background-color: var(--shy-active-tint);
--urlbarview-action-button-background-color: var(--shy-hover-tint);
--urlbarview-action-button-background-color-hover: var(--shy-active-tint);
/* the row buttons kept their names across both builds */
--urlbarView-result-button-selected-color: var(--bt-col);
--urlbarView-result-button-selected-background-color: var(--shy-hover-tint);
--urlbarView-result-button-hover-color: var(--bt-col);
--urlbarView-result-button-hover-background-color: var(--shy-active-tint);
/* the overlay's list scrolls; keep its scrollbar quiet and inside the rounded plate */
scrollbar-width: thin;
scrollbar-color: var(--shy-scrollbar) !important;
overscroll-behavior: contain;
}
/* rows read as chips rather than full-bleed stripes. Firefox already insets them with a transparent
gutter border to keep the hover area contiguous, so this only adds 2px and pins the radius, which
is otherwise derived from a different token in each build. */
.urlbarView .urlbarView-row {
border-radius: var(--rounding) !important;
margin-inline: 2px !important;
}
/* SELECTION. shy-global.css:598 paints the selected row `background-color: var(--shy-accent-color)
!important` at (0,2,0), which puts text on an unknown-luminance accent. This is the accessible
replacement: a tint the row's own --bt-col stays readable on, at (0,3,0) and later in the import
order, so it wins on both counts. */
.urlbarView .urlbarView-row[selected] {
background-color: var(--shy-accent-tint) !important;
color: var(--bt-col) !important;
}
/* the solid accent goes on a bar at the leading edge, where nothing sits on top of it. It hangs off
.urlbarView-row-inner because .urlbarView-row::before is already the group label and ::after the
feedback acknowledgement, in both builds. */
.urlbarView .urlbarView-row[selected] > .urlbarView-row-inner {
position: relative;
}
.urlbarView .urlbarView-row[selected] > .urlbarView-row-inner::before {
content: "";
position: absolute;
inset-block: 25%;
inset-inline-start: 2px;
width: 3px;
border-radius: 3px !important;
background-color: var(--shy-color) !important;
pointer-events: none;
}
/* the url is secondary information. shy-global.css:592 paints it with the full accent at (0,3,0)
!important, which makes it compete with the title; (0,4,0) here dims it back down. The selected
row is deliberately left out so its url inherits the row's --bt-col and stays high contrast. */
.urlbarView .urlbarView-row:not([selected]) .urlbarView-url,
.urlbarView .urlbarView-row:not([selected]) .urlbarView-explanation {
color: var(--shy-text-dim) !important;
}
/* "-- Search with Google" and friends. Firefox only dims the action on a resting row; keeping that
condition means hover and selection still brighten it. */
.urlbarView .urlbarView-row:not([selected], :hover) .urlbarView-action {
color: var(--shy-text-dim) !important;
}
/* favicons are square site images sitting in rounded rows; both builds already centre them on the
row's icon axis, so this is colour and shape only. Icons come up to full strength on the row the
keyboard or the pointer is on. */
.urlbarView .urlbarView-favicon {
border-radius: calc(var(--rounding) / 3) !important;
}
.urlbarView .urlbarView-row:is([selected], :hover) {
fill-opacity: 1 !important;
}
/* the list drops in behind the field once results arrive */
#main-window:not([customizing]) #urlbar[open] > .urlbarView {
animation: shy-drop-in var(--shy-dur) var(--shy-ease) !important;
}
/*== ONE-OFF SEARCH ENGINES =========================================================================
The engine strip under the results. Same chip language as the rows above it; the selected engine
gets a tint and a ring instead of the solid highlight fill Firefox uses.
*/
#main-window #urlbar .searchbar-engine-one-off-item {
border-radius: var(--rounding) !important;
transition: background-color var(--shy-dur-fast) var(--shy-ease) !important;
}
#main-window #urlbar .searchbar-engine-one-off-item:not([selected]):hover {
background-color: var(--shy-hover-tint) !important;
}
#main-window #urlbar .searchbar-engine-one-off-item[selected] {
background-color: var(--shy-accent-tint) !important;
box-shadow: inset 0 0 0 1px var(--shy-accent-line) !important;
color: var(--bt-col) !important;
}
/* "This time, search with" */
#main-window #urlbar :is(.search-panel-one-offs-header-label, .search-panel-header > label) {
color: var(--shy-text-dim) !important;
opacity: 1 !important;
}
/*== FLOATING OVERLAY ===============================================================================
ShyFox's signature moment. shy-floating-search.css owns every coordinate here and gives the plate a
flat fill, a hard 1px accent outline and one flat shadow; these rules carry its selector verbatim so
they win on import order alone and not one position property is restated.
The entrance moves the field 6px over 150ms. Both numbers are deliberate: the smoke test reads the
input's rectangle roughly 100ms after focus, and this easing has settled to a fifth of a pixel by
then, so the measured geometry is the resting geometry.
*/
@media not -moz-pref("shyfox.disable.floating.search") {
#main-window:not([customizing], [inDOMFullscreen="true"])
#urlbar:is([focused], :focus-within, [open], [breakout-extend]) {
/* command-palette surface: glass fill, one refined accent hairline, real elevation */
:is(#urlbar-background, .urlbar-background) {
background-color: var(--shy-surface) !important;
border-color: transparent !important;
outline: 1px solid var(--shy-accent-line) !important;
outline-offset: 0 !important;
box-shadow: var(--shy-elev-3) !important;
animation: shy-drop-in var(--shy-urlbar-enter) var(--shy-ease) !important;
}
/* the text drops in with the plate; without this the fill would move and the caret would not */
:is(#urlbar-input-container, .urlbar-input-container) {
animation: shy-drop-in var(--shy-urlbar-enter) var(--shy-ease) !important;
}
/* the page behind the overlay. #urlbar always carries popover="manual", so the ::before scrim
in shy-floating-search.css is switched off by its own [popover] rule and ::backdrop is the
one that paints. */
&::backdrop {
background: color-mix(in srgb, var(--bg-col) var(--shy-scrim-opct), transparent) !important;
animation: shy-fade-in var(--shy-dur) var(--shy-ease) !important;
}
}
/* Blur is decoration and Gecko may decline to paint it, so --shy-surface-opct has to carry the
surface on its own. Two blurred layers at once, well inside the budget. */
@media not -moz-pref("shyfox.disable.blur") {
#main-window:not([customizing], [inDOMFullscreen="true"])
#urlbar:is([focused], :focus-within, [open], [breakout-extend]) {
:is(#urlbar-background, .urlbar-background) {
backdrop-filter: blur(var(--shy-glass-blur)) saturate(var(--shy-glass-saturate)) !important;
}
&::backdrop {
backdrop-filter: blur(calc(var(--shy-glass-blur) / 3)) !important;
}
}
}
}
/*== INLINE MODE ====================================================================================
With shyfox.disable.floating.search the field stays in the toolbar and drops its results downwards.
Same material one step quieter: elevation 2 instead of 3, and no entrance -- a 40px field inside a
toolbar that is itself sliding into view does not need a second animation.
*/
@media -moz-pref("shyfox.disable.floating.search") {
#main-window:not([customizing]) #urlbar:is([open], [breakout-extend])
:is(#urlbar-background, .urlbar-background) {
background-color: var(--shy-surface) !important;
box-shadow: var(--shy-elev-2) !important;
outline: 1px solid var(--shy-accent-line) !important;
outline-offset: 0 !important;
}
@media not -moz-pref("shyfox.disable.blur") {
#main-window:not([customizing]) #urlbar:is([open], [breakout-extend])
:is(#urlbar-background, .urlbar-background) {
backdrop-filter: blur(var(--shy-glass-blur)) saturate(var(--shy-glass-saturate)) !important;
}
}
}
/*== SEARCHBAR ======================================================================================
The separate #searchbar widget is laid out vertically in the right-hand strip: shy-toolbar.css:124
puts writing-mode: vertical-rl on its textbox, pins its height and absolutely positions its buttons.
Only colour and the focus ring are touched here -- no border, no padding, no size, no writing-mode,
so nothing about that layout moves.
*/
#main-window:not([customizing]) #searchbar {
background-color: var(--shy-field-idle) !important;
transition:
background-color var(--shy-dur-fast) var(--shy-ease),
box-shadow var(--shy-dur-fast) var(--shy-ease);
}
/* replaces the platform focus outline and 140's flat drop shadow with the same accent ring the
address bar gets, so the two fields read as one family */
#main-window:not([customizing]) #searchbar:focus-within {
background-color: var(--shy-surface-raised) !important;
outline: none !important;
box-shadow: var(--shy-accent-glow) !important;
}
/*== GRACEFUL DEGRADATION ===========================================================================
Restated rather than inherited: this file is imported after shy-compat.css, so its reduced-motion and
forced-colours blocks have already been passed by the time these rules are read.
*/
@media (prefers-reduced-motion: reduce) {
/* zero the local clocks first -- every duration in this file comes from one of these or from the
shy-dur family, which shy-tokens.css already zeroes here */
:root {
--shy-urlbar-enter: 0s;
--shy-dur-press: 0s;
}
/* and remove the declarations outright, at the specificity they were written with */
#main-window:not([customizing]) #urlbar :is(#urlbar-background, .urlbar-background),
#main-window:not([customizing], [inDOMFullscreen="true"])
#urlbar:is([focused], :focus-within, [open], [breakout-extend])
:is(#urlbar-background, .urlbar-background),
#main-window:not([customizing], [inDOMFullscreen="true"])
#urlbar:is([focused], :focus-within, [open], [breakout-extend])
:is(#urlbar-input-container, .urlbar-input-container),
#main-window:not([customizing]) #urlbar[open] > .urlbarView,
#main-window #urlbar :is(#urlbar-go-button, .urlbar-go-button, .urlbar-page-action,
#urlbar-revert-button-container),
#main-window #urlbar .searchbar-engine-one-off-item,
#main-window:not([customizing]) #searchbar {
animation: none !important;
transition: none !important;
}
#main-window:not([customizing], [inDOMFullscreen="true"])
#urlbar:is([focused], :focus-within, [open], [breakout-extend])::backdrop {
animation: none !important;
transition: none !important;
}
}
@media (forced-colors: active) {
/* No translucency, no blur, no shadows: system colours only. Every field selector used above is
restated so this reset outranks each of them at its own specificity rather than by luck. */
#main-window:not([customizing]) #urlbar :is(#urlbar-background, .urlbar-background),
#main-window:not([customizing]) #urlbar:not(:is([focused], :focus-within, [open], [breakout-extend]))
:is(#urlbar-background, .urlbar-background),
#main-window:not([customizing]) #urlbar:not(:is([focused], :focus-within, [open], [breakout-extend])):hover
:is(#urlbar-background, .urlbar-background),
#main-window:not([customizing]) #urlbar:is([focused], :focus-within, [open], [breakout-extend])
:is(#urlbar-background, .urlbar-background),
#main-window:not([customizing], [inDOMFullscreen="true"])
#urlbar:is([focused], :focus-within, [open], [breakout-extend])
:is(#urlbar-background, .urlbar-background),
#main-window:not([customizing]) #searchbar,
#main-window:not([customizing]) #searchbar:focus-within {
background-color: Field !important;
border: 1px solid FieldText !important;
outline: none !important;
box-shadow: none !important;
backdrop-filter: none !important;
}
/* focus still has to be visible, so the ring comes back as the system highlight */
#main-window:not([customizing]) #urlbar:is([focused], :focus-within, [open], [breakout-extend])
:is(#urlbar-background, .urlbar-background),
#main-window:not([customizing], [inDOMFullscreen="true"])
#urlbar:is([focused], :focus-within, [open], [breakout-extend])
:is(#urlbar-background, .urlbar-background),
#main-window:not([customizing]) #searchbar:focus-within {
outline: 2px solid Highlight !important;
outline-offset: 0 !important;
}
#main-window:not([customizing], [inDOMFullscreen="true"])
#urlbar:is([focused], :focus-within, [open], [breakout-extend])::backdrop {
background: Canvas !important;
backdrop-filter: none !important;
}
/* the one place the tint-plus-bar treatment has to give way: forced colours guarantee the
Highlight / HighlightText pair contrasts, and nothing else here does */
.urlbarView .urlbarView-row[selected] {
background-color: Highlight !important;
color: HighlightText !important;
}
.urlbarView .urlbarView-row[selected] > .urlbarView-row-inner::before {
background-color: HighlightText !important;
}
.urlbarView .urlbarView-row:not([selected]) .urlbarView-url,
.urlbarView .urlbarView-row:not([selected]) .urlbarView-explanation,
.urlbarView .urlbarView-row:not([selected], :hover) .urlbarView-action {
color: LinkText !important;
}
/* the accent-tinted chips become plain outlined ones. The ring is an inset outline rather than a
border so the chips keep the size they have everywhere else. */
#main-window #urlbar > :is(#urlbar-input-container, .urlbar-input-container) > #urlbar-label-box,
#main-window #urlbar[searchmode]
:is(#urlbar-search-mode-indicator, #searchmode-switcher-chicklet),
#main-window #urlbar .searchbar-engine-one-off-item[selected],
.urlbarView .urlbarView-row[has-action]:is([type="switchtab"], [type="remotetab"], [type="clipboard"])
.urlbarView-action {
background-color: Canvas !important;
color: CanvasText !important;
box-shadow: none !important;
outline: 1px solid CanvasText !important;
outline-offset: -1px !important;
}
#main-window #urlbar :is(#urlbar-input, .urlbar-input)::selection {
background-color: Highlight !important;
color: HighlightText !important;
}
}
} /* shyfox.disable.polish */