urlbarView.css (59590B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 @import url("chrome://browser/skin/urlbar-dynamic-results.css"); 6 7 @namespace html url("http://www.w3.org/1999/xhtml"); 8 9 :root { 10 --urlbarView-hover-background: var(--arrowpanel-dimmed); 11 --urlbarView-separator-color: color-mix(in srgb, currentColor 14%, transparent); 12 13 --urlbarView-highlight-background: SelectedItem; 14 --urlbarView-highlight-color: SelectedItemText; 15 16 --urlbarView-secondary-text-color: color-mix(in srgb, currentColor 73%, transparent); 17 18 --urlbarView-action-color: LinkText; 19 --urlbarView-action-slide-in-distance: 200px; 20 21 --urlbarView-small-font-size: 0.85em; 22 23 --urlbarView-results-padding: 7px; 24 --urlbarView-row-gutter: 2px; 25 --urlbarView-item-inline-padding: var(--urlbar-icon-padding); 26 --urlbarView-item-block-padding: 6px; 27 28 /* The inline margins of a row icon. Rows with different icon sizes will define 29 different values for these variables so that the icons of all rows are 30 center-aligned along one vertical axis. Row icons happen to use the 31 `.urlbarView-favicon` class but not all icons are favicons (e.g., rich 32 search suggestion icons are images from the search engine). */ 33 --urlbarView-icon-margin-start: 0px; 34 --urlbarView-icon-margin-end: calc(var(--urlbar-icon-padding) + var(--identity-box-margin-inline)); 35 36 /* The size and inline margins of a standard 16px favicon. The margin variables 37 can be used to align any 16px content along the vertical icon axis. */ 38 --urlbarView-favicon-width: 16px; 39 --urlbarView-favicon-margin-start: var(--urlbarView-icon-margin-start); 40 --urlbarView-favicon-margin-end: var(--urlbarView-icon-margin-end); 41 42 --urlbarView-rich-suggestion-default-icon-size: 28px; 43 --urlbarView-top-pick-large-icon-box-size: 52px; 44 45 --urlbarView-result-button-size: 24px; 46 --urlbarView-result-button-background-opacity: 60%; 47 --urlbarView-result-button-selected-color: var(--toolbar-field-focus-color); 48 --urlbarView-result-button-selected-background-color: color-mix( 49 in srgb, 50 var(--toolbar-field-focus-background-color) var(--urlbarView-result-button-background-opacity), 51 transparent 52 ); 53 --urlbarView-result-button-hover-color: var(--toolbar-field-focus-background-color); 54 --urlbarView-result-button-hover-background-color: color-mix( 55 in srgb, 56 var(--toolbar-field-focus-color) var(--urlbarView-result-button-background-opacity), 57 transparent 58 ); 59 60 --urlbarView-labeled-row-margin-top: calc(1.46em + 4px); 61 --urlbarView-labeled-row-label-top: calc(-1.27em - 2px); 62 --urlbarView-labeled-tip-margin-top-extra: 8px; 63 64 --urlbarView-action-button-background-color: color-mix(in srgb, var(--urlbarView-hover-background) 50%, transparent); 65 --urlbarView-action-button-hover-background-color: var(--urlbarView-hover-background); 66 67 &:-moz-locale-dir(rtl) { 68 --urlbarView-action-slide-in-distance: -200px; 69 } 70 71 &[lwtheme] { 72 --urlbarView-action-color: light-dark(rgb(91, 91, 102), rgb(191, 191, 201)); 73 --urlbarView-highlight-background: light-dark(rgb(0, 99, 255), rgb(0, 99, 225)); 74 --urlbarView-highlight-color: white; 75 } 76 77 @media (prefers-contrast) { 78 --urlbarView-separator-color: color-mix(in srgb, currentColor 86%, transparent); 79 --urlbarView-result-button-background-opacity: 100%; 80 --urlbarView-secondary-text-color: currentColor; 81 } 82 83 /* stylelint-disable-next-line media-query-no-invalid */ 84 @media -moz-pref("browser.urlbar.richSuggestions.featureGate") { 85 --urlbarView-favicon-margin-start: calc((var(--urlbarView-rich-suggestion-default-icon-size) - var(--urlbarView-favicon-width)) / 2); 86 --urlbarView-favicon-margin-end: calc( 87 var(--urlbar-icon-padding) + var(--identity-box-margin-inline) + 88 ((var(--urlbarView-rich-suggestion-default-icon-size) - var(--urlbarView-favicon-width)) / 2) 89 ); 90 } 91 } 92 93 .urlbarView { 94 /* Don't handle window drag events in case we are overlapping a toolbar */ 95 -moz-window-dragging: no-drag; 96 97 display: block; 98 text-shadow: none; 99 overflow: clip; 100 margin-inline: var(--urlbarView-results-padding); 101 width: calc(100% - 2 * var(--urlbarView-results-padding)); 102 } 103 104 .urlbarView-body-inner { 105 width: calc(100% + 2 * var(--urlbarView-row-gutter)); 106 margin-inline: calc(-1 * var(--urlbarView-row-gutter)); 107 108 #urlbar[open] > .urlbarView > .urlbarView-body-outer > & { 109 border-top: 1px solid var(--urlbarView-separator-color); 110 } 111 } 112 113 .urlbarView-results { 114 padding-block: calc(var(--urlbarView-results-padding) - var(--urlbarView-row-gutter)); 115 white-space: nowrap; 116 117 /* Vertically center the one-offs when no results are present. */ 118 .urlbarView[noresults] > .urlbarView-body-outer > .urlbarView-body-inner > & { 119 padding-block: 0; 120 } 121 } 122 123 .urlbarView-row { 124 --urlbarView-second-line-indent: calc(var(--urlbarView-icon-margin-start) + var(--urlbarView-icon-margin-end) + var(--urlbarView-favicon-width)); 125 126 /* Align icons that are smaller than the default rich suggestion icon size 127 (28px) with default-size rich suggestion icons. */ 128 /* stylelint-disable-next-line media-query-no-invalid */ 129 @media -moz-pref("browser.urlbar.richSuggestions.featureGate") { 130 &:not([rich-suggestion]), 131 &[rich-suggestion][icon-size="16"] { 132 --urlbarView-icon-margin-start: var(--urlbarView-favicon-margin-start); 133 --urlbarView-icon-margin-end: var(--urlbarView-favicon-margin-end); 134 } 135 &[rich-suggestion][icon-size="24"] { 136 --urlbarView-icon-margin-start: calc((var(--urlbarView-rich-suggestion-default-icon-size) - 24px) / 2); 137 --urlbarView-icon-margin-end: calc( 138 var(--urlbar-icon-padding) + var(--identity-box-margin-inline) + ((var(--urlbarView-rich-suggestion-default-icon-size) - 24px) / 2) 139 ); 140 } 141 } 142 143 display: flex; 144 align-items: center; 145 fill: currentColor; 146 fill-opacity: var(--urlbar-icon-fill-opacity); 147 148 /* Use a transparent border rather than margin such that the view's entire 149 hover area is contiguous and a row is always hovered as the user moves the 150 mouse across rows, even though each row's highlighted area is smaller. */ 151 border: var(--urlbarView-row-gutter) solid transparent; 152 border-radius: calc(var(--urlbarView-row-gutter) + var(--urlbar-inner-border-radius)); 153 background-clip: padding-box; 154 155 /* Must hide the overflowing rows while the view is updating */ 156 &[hidden] { 157 display: none !important; 158 } 159 160 &[row-selectable]:not([selected]):hover { 161 background-color: var(--urlbarView-hover-background); 162 } 163 164 &[selected] { 165 background-color: var(--urlbarView-highlight-background); 166 color: var(--urlbarView-highlight-color); 167 } 168 169 &:not([type="tip"], [type="dynamic"]) { 170 :root:not([uidensity="compact"]) & { 171 min-height: 32px; 172 } 173 :root[uidensity="touch"] & { 174 padding-block: 11px; 175 } 176 } 177 178 &[rich-suggestion][type="search"] { 179 :root:not([uidensity="compact"]) & { 180 min-height: 46px; 181 } 182 :root[uidensity="touch"] & { 183 padding-block: 4px; 184 } 185 } 186 } 187 188 .urlbarView-row-inner, 189 .urlbarView-no-wrap { 190 display: inline-flex; 191 flex-wrap: nowrap; 192 align-items: baseline; 193 justify-content: start; 194 } 195 196 .urlbarView-row-inner { 197 flex: 1 1; 198 overflow: hidden; 199 padding-inline: var(--urlbarView-item-inline-padding); 200 padding-block: var(--urlbarView-item-block-padding); 201 202 :root:not([uidensity="compact"]) & { 203 min-height: 20px; /* row min-height 32px - (2 * padding-block 6px) */ 204 } 205 } 206 207 .urlbarView-no-wrap { 208 max-width: 100%; 209 flex-grow: 0; 210 flex-shrink: 0; 211 212 .urlbarView[action-override] .urlbarView-row[has-url] > .urlbarView-row-inner > &, 213 .urlbarView-row[has-url]:not([type$="tab"]) > .urlbarView-row-inner > &, 214 .urlbarView-row[has-url]:is([type="remotetab"], [sponsored]):is(:hover, [selected]) > .urlbarView-row-inner > & { 215 /* We prioritize icons + title + action over the url, so they can grow freely, 216 but the url should never disappear when it's visible */ 217 max-width: calc(70% - 2 * (var(--urlbarView-favicon-width) + (6px + 2px))); 218 } 219 } 220 221 /* Wrap the url to a second line when the window is narrow. Do not wrap when the 222 window is also short, because fewer results will be shown. */ 223 @media screen and (min-height: 600px) { 224 .urlbarView-results[wrap] > .urlbarView-row { 225 &:where(:not([rich-suggestion])) > .urlbarView-row-inner { 226 flex-wrap: wrap; 227 228 > .urlbarView-no-wrap { 229 max-width: 100% !important; 230 flex-basis: 100%; 231 } 232 } 233 234 &[has-url] > .urlbarView-row-inner > .urlbarView-url { 235 margin-top: 2px; 236 237 /* urlbarView-url is forced to be LTR for RTL locales, so set the padding based on 238 the browser's directionality. */ 239 &:-moz-locale-dir(ltr) { 240 margin-left: var(--urlbarView-second-line-indent); 241 } 242 &:-moz-locale-dir(rtl) { 243 margin-right: var(--urlbarView-second-line-indent); 244 } 245 } 246 247 /* Note: switchtab entries show the url only in override mode, 248 remotetab and sponsored ones only when selected or :hover. */ 249 .urlbarView[action-override] &[has-url]:not([restyled-search]), 250 &[has-url]:not([type$="tab"], [sponsored], [restyled-search]), 251 &[has-url]:is([type="remotetab"], [sponsored]):is(:hover, [selected]), 252 &[type="tabtosearch"] { 253 /* This targets both rich and non-rich results, so not using the child selector here. */ 254 .urlbarView-title-separator { 255 display: none; 256 } 257 } 258 259 &[type="tabtosearch"] > .urlbarView-row-inner > .urlbarView-no-wrap { 260 flex-wrap: wrap; 261 262 > .urlbarView-action { 263 flex-basis: 100%; 264 margin-inline-start: var(--urlbarView-second-line-indent); 265 } 266 } 267 268 &[rich-suggestion] > .urlbarView-row-inner > .urlbarView-row-body > .urlbarView-row-body-top { 269 flex-wrap: wrap; 270 271 > .urlbarView-row-body-top-no-wrap { 272 flex-basis: 100%; 273 } 274 275 > .urlbarView-url { 276 margin-top: 2px; 277 } 278 } 279 } 280 } 281 282 .urlbarView-overflowable, 283 .urlbarView-url { 284 overflow: hidden; 285 } 286 287 .urlbarView-overflowable[overflow], 288 .urlbarView-url[overflow] { 289 mask-image: linear-gradient(to left, transparent, black 2em); 290 } 291 292 .urlbarView-overflowable[overflow]:not(.urlbarView-title[is-url]):-moz-locale-dir(rtl) { 293 mask-image: linear-gradient(to right, transparent, black 2em); 294 } 295 296 .urlbarView-title[is-url]:-moz-locale-dir(rtl), 297 .urlbarView-url:-moz-locale-dir(rtl) { 298 direction: ltr !important; 299 } 300 301 .urlbarView-url:-moz-locale-dir(rtl) { 302 /* .urlbarView-url can grow due to `flex-grow: 1`, so without `text-align: 303 right`, the URL text would be left-aligned within .urlbarView-url for RTL 304 due to the `direction: ltr` rule. .urlbarView-title does not have this 305 problem since it does not have flex. */ 306 text-align: right; 307 } 308 309 /* Favicon */ 310 311 .urlbarView-favicon { 312 width: var(--urlbarView-favicon-width); 313 height: var(--urlbarView-favicon-width); 314 align-self: center; 315 margin-inline-start: var(--urlbarView-icon-margin-start); 316 margin-inline-end: var(--urlbarView-icon-margin-end); 317 background-repeat: no-repeat; 318 background-size: contain; 319 object-fit: contain; 320 flex-shrink: 0; 321 -moz-context-properties: fill, fill-opacity; 322 323 .urlbarView-row[tail-suggestion] > .urlbarView-row-inner > .urlbarView-no-wrap > & { 324 visibility: hidden; 325 } 326 327 .urlbarView-row[type="tabtosearch"]:not([selected]) > .urlbarView-row-inner > .urlbarView-no-wrap > & { 328 /* We use the URL color for this icon to inherit its accessibility 329 properties, like adapting to high contrast modes. We also want to ensure 330 contrast from the result highlight. */ 331 color: var(--link-color); 332 -moz-context-properties: fill; 333 } 334 } 335 336 /* Type icon */ 337 338 .urlbarView-type-icon { 339 position: absolute; 340 width: var(--icon-size-xsmall); 341 height: var(--icon-size-xsmall); 342 align-self: center; 343 margin-top: var(--urlbarView-favicon-width); 344 margin-inline-start: calc(var(--urlbarView-icon-margin-start) + var(--urlbarView-favicon-width) - 6px); 345 background-repeat: no-repeat; 346 background-size: contain; 347 -moz-context-properties: fill, stroke; 348 stroke: var(--toolbar-field-focus-background-color); 349 350 /* Favicon badges have this priority: pinned > bookmark. */ 351 .urlbarView-row[type="bookmark"] > .urlbarView-row-inner > .urlbarView-no-wrap > & { 352 background-image: url(chrome://browser/skin/bookmark-12.svg); 353 fill: var(--toolbarbutton-icon-fill-attention); 354 } 355 356 .urlbarView-row[pinned] > .urlbarView-row-inner > .urlbarView-no-wrap > & { 357 background-image: url(chrome://browser/skin/pin-12.svg); 358 fill: light-dark(rgb(91, 91, 102), rgb(251, 251, 254)); 359 } 360 361 /* The following badges are used for debugging purposes */ 362 /* stylelint-disable-next-line media-query-no-invalid */ 363 @media -moz-pref("browser.urlbar.showDebuggingIcons") { 364 .urlbarView-row[type] > .urlbarView-row-inner > .urlbarView-no-wrap > &::before { 365 display: flex; 366 position: absolute; 367 background-color: var(--button-background-color); 368 justify-content: center; 369 align-items: center; 370 border-radius: var(--border-radius-circle); 371 width: var(--icon-size-xsmall); 372 height: var(--icon-size-xsmall); 373 font-size: 10px; 374 } 375 376 /* Can't nest due to https://github.com/w3c/csswg-drafts/issues/7433 */ 377 .urlbarView-row[type="adaptive-history"] > .urlbarView-row-inner > .urlbarView-no-wrap > &::before { 378 content: "A"; 379 } 380 .urlbarView-row[type="semantic-history"] > .urlbarView-row-inner > .urlbarView-no-wrap > &::before { 381 content: "S"; 382 } 383 } 384 } 385 386 /* Buttons */ 387 388 .urlbarView-row-buttons { 389 display: flex; 390 align-items: center; 391 justify-content: end; 392 flex-wrap: wrap; 393 } 394 395 .urlbarView-button { 396 display: inline-block; 397 min-width: var(--urlbarView-result-button-size); 398 min-height: var(--urlbarView-result-button-size); 399 background-size: 16px; 400 background-position: center; 401 background-repeat: no-repeat; 402 margin-inline: 4px; 403 -moz-context-properties: fill, fill-opacity; 404 border-radius: var(--border-radius-circle); 405 406 &:not(:hover, [selected], [primary], [open]) { 407 @media (prefers-contrast) { 408 outline: 1px solid currentColor; 409 outline-offset: -1px; 410 } 411 } 412 413 &[selected] { 414 outline: var(--focus-outline); 415 /* This color assumes that the row is selected and therefore has the usual 416 selection background color. */ 417 outline-color: var(--urlbarView-highlight-color); 418 outline-offset: 1px; 419 420 .urlbarView-row:not([selected]) > .urlbarView-row-buttons > & { 421 /* If the row is not selected, use the accent color instead. */ 422 outline-color: var(--border-color-selected); 423 } 424 } 425 426 .urlbarView-row:is([row-selectable]:hover, [selected]) > &:not(:hover, [open]) { 427 color: var(--urlbarView-result-button-selected-color); 428 background-color: var(--urlbarView-result-button-selected-background-color); 429 } 430 431 &:is(:hover, [open]) { 432 color: var(--urlbarView-result-button-hover-color); 433 background-color: var(--urlbarView-result-button-hover-background-color); 434 } 435 436 & + & { 437 margin-inline-start: 0; 438 } 439 } 440 441 /* Result menu button */ 442 443 .urlbarView-button-result-menu { 444 background-image: url("chrome://global/skin/icons/more.svg"); 445 background-color: var(--button-background-color); 446 447 .urlbarView-results:not([disable-resultmenu-autohide]) 448 > .urlbarView-row:not(:hover, [selected], [descendant-selected]) 449 > .urlbarView-row-buttons 450 > &:not([open]):first-child:empty { 451 /* The realtime suggestions' style will be broken if the width will be 452 changed by hover. Thus we use the visibility instead of display to keep 453 the element size */ 454 visibility: hidden; 455 456 .urlbarView-row:not([dynamicType^="realtime-"]) > .urlbarView-row-buttons > & { 457 display: none; 458 } 459 } 460 461 /* Labeled result menu button */ 462 463 &:not(:empty) { 464 .urlbarView-results:not([wrap]) > .urlbarView-row > .urlbarView-row-buttons > & { 465 display: inline-flex; 466 align-items: center; 467 border-radius: var(--urlbarView-result-button-size); 468 padding-inline: 8px 26px; 469 background-position-x: right 4px; 470 font-size: var(--urlbarView-small-font-size); 471 472 &:-moz-locale-dir(rtl) { 473 background-position-x: left 4px; 474 } 475 } 476 477 .urlbarView-results[wrap] > .urlbarView-row > .urlbarView-row-buttons > & { 478 /* Hide the label in narrow windows. */ 479 font-size: 0; 480 } 481 } 482 } 483 484 /* Button with label, e.g. tip button */ 485 486 .urlbarView-button:where(:not(:empty):not(.urlbarView-button-result-menu)), 487 .urlbarView-splitbutton-dropmarker { 488 border-radius: var(--urlbar-inner-border-radius); 489 padding: 0.5em 1em; 490 font-size: 0.93em; 491 font-weight: var(--font-weight-semibold); 492 background-clip: padding-box; 493 min-height: 16px; 494 min-width: 6em; 495 text-align: center; 496 flex-basis: initial; 497 flex-shrink: 0; 498 499 &:not(:hover, [open]) { 500 background-color: var(--button-background-color); 501 } 502 503 &:is([selected], [primary]) { 504 color: var(--button-text-color-primary); 505 background-color: var(--color-accent-primary); 506 outline-color: var(--border-color-selected); 507 outline-offset: var(--focus-outline-offset); 508 509 &:hover { 510 background-color: var(--color-accent-primary-hover); 511 } 512 513 &:hover:active { 514 background-color: var(--color-accent-primary-active); 515 } 516 } 517 } 518 519 /* Split Button component */ 520 .urlbarView-splitbutton { 521 display: flex; 522 } 523 524 .urlbarView-splitbutton-main { 525 /* Make the cap to the dropmarker */ 526 margin-inline-end: 1px; 527 border-start-end-radius: 0; 528 border-end-end-radius: 0; 529 } 530 531 .urlbarView-splitbutton-dropmarker { 532 background-image: url("chrome://global/skin/icons/arrow-down-12.svg"); 533 border-start-start-radius: 0; 534 border-end-start-radius: 0; 535 padding-inline: 0; 536 min-width: 2em; 537 border-inline-start: none; 538 -moz-context-properties: fill; 539 fill: currentColor; 540 } 541 542 /* Row label (a.k.a. group label) */ 543 544 .urlbarView-row[label] { 545 position: relative; 546 /* `margin-block-start` controls how far the main part of the row is from the 547 main part of the previous row. */ 548 margin-block-start: var(--urlbarView-labeled-row-margin-top); 549 550 &::before { 551 content: attr(label); 552 display: block; 553 /* Remove the label from the document flow so it doesn't affect the row 554 selection and hover states. */ 555 position: absolute; 556 /* `top` controls how far the label is from the main part of the row. */ 557 top: var(--urlbarView-labeled-row-label-top); 558 margin-inline-start: var(--urlbarView-item-inline-padding); 559 font-size: 0.8em; 560 /* The color and opacity of labels is the same as the "This time, search with" 561 text in the search shortcuts. See `.search-panel-header > label` in 562 searchbar.css. */ 563 color: var(--toolbar-field-focus-color); 564 opacity: 0.6; 565 pointer-events: none; 566 } 567 568 /* For tips with row labels, the entire row is moved down by an additional 569 var(--urlbarView-labeled-tip-margin-top-extra) so there's more space 570 between the tip's top border and the label; see the tip rules. Here we 571 compensate so that the label remains the same distance from the previous 572 row as it would have had we not moved the tip row down. +1px compensates 573 for the tip's top 1px border. */ 574 &[type="tip"]::before { 575 top: calc(var(--urlbarView-labeled-row-label-top) - var(--urlbarView-labeled-tip-margin-top-extra) + 1px); 576 } 577 578 :root[lwt-toolbar-field-focus="dark"] &::before { 579 /* Same as `.search-panel-header > label` in searchbar.css */ 580 opacity: 1; 581 } 582 } 583 584 /* Feedback acknowledgment */ 585 586 .urlbarView-row[feedback-acknowledgment] { 587 position: relative; 588 padding-bottom: 1.94em; 589 590 &::after { 591 content: attr(feedback-acknowledgment); 592 display: flex; 593 align-items: center; 594 position: absolute; 595 bottom: 0.72em; 596 font-size: var(--urlbarView-small-font-size); 597 margin-inline-start: calc(var(--urlbarView-item-inline-padding) + var(--urlbarView-favicon-margin-start)); 598 padding-inline-start: calc(var(--urlbarView-favicon-width) + var(--urlbarView-favicon-margin-end)); 599 background-image: url("chrome://branding/content/icon32.png"); 600 background-repeat: no-repeat; 601 background-position: 0 center; 602 background-size: var(--urlbarView-favicon-width); 603 min-height: var(--urlbarView-favicon-width); 604 } 605 } 606 607 /* Title */ 608 609 .urlbarView-title { 610 white-space: nowrap; 611 /* Explicitly set line-height to avoid excessively tall rows if the title triggers use of 612 fallback fonts with extreme metrics. */ 613 line-height: 1.4; 614 } 615 616 /* user context box */ 617 .urlbarView-userContext { 618 border-top: 4px solid var(--identity-tab-color); 619 } 620 621 .urlbarView-userContext-icon { 622 height: 14px; 623 width: 14px; 624 -moz-context-properties: fill; 625 vertical-align: top; 626 } 627 628 .urlbarView-userContext-textMode > span { 629 font-variant: small-caps; 630 } 631 632 /* Display userContext icon instead of text when window is too narrow. */ 633 .urlbarView-results[wrap] .urlbarView-userContext-textMode, 634 .urlbarView-results:not([wrap]) .urlbarView-userContext-iconMode { 635 display: none; 636 } 637 638 /* Display a shortened version of the tab label when window is too narrow. */ 639 .urlbarView-results[wrap] .urlbarView-tabGroup-fullWidthMode, 640 .urlbarView-results:not([wrap]) .urlbarView-tabGroup-narrowWidthMode { 641 display: none; 642 } 643 644 /* Force the tab group result chiclet to appear at full height, even if it has 645 * no text in it. This is the case if the group has no name and the chiclet is 646 * in narrow mode. */ 647 .urlbarView-results[wrap] .urlbarView-tabGroup-narrowWidthMode { 648 display: inline-block; 649 } 650 651 /* Tail suggestions */ 652 653 .urlbarView-tail-prefix { 654 display: none; 655 justify-content: flex-end; 656 white-space: pre; 657 658 .urlbarView-row[tail-suggestion] > .urlbarView-row-inner > .urlbarView-no-wrap > & { 659 display: inline-flex; 660 } 661 662 > .urlbarView-tail-prefix-string { 663 visibility: hidden; 664 } 665 666 > .urlbarView-tail-prefix-char { 667 position: absolute; 668 } 669 } 670 671 /* Title separator */ 672 673 .urlbarView-title-separator { 674 &::before { 675 content: "\2014"; 676 margin: 0 0.4em; 677 opacity: 0.6; 678 } 679 680 .urlbarView-title:empty + .urlbarView-tags:empty + &, 681 /* This targets both rich and non-rich results, so not using the child selector here. */ 682 .urlbarView-row:is([type=search], [restyled-search]):not([selected], [show-action-text], :hover) &, 683 .urlbarView-row:not([has-action], [has-url], [restyled-search]) & { 684 display: none; 685 } 686 687 #searchbar-new & { 688 display: none; 689 } 690 } 691 692 /* Action labels */ 693 694 .urlbarView-action { 695 white-space: nowrap; 696 697 .urlbarView-title:not(:empty) ~ & { 698 font-size: var(--urlbarView-small-font-size); 699 700 /* stylelint-disable-next-line media-query-no-invalid */ 701 @media not -moz-pref("browser.urlbar.scotchBonnet.enableOverride") { 702 /* This targets both rich and non-rich results, so not using the child selector here. */ 703 .urlbarView-row:not(:hover, [selected], [sponsored]) & { 704 color: var(--urlbarView-action-color); 705 } 706 } 707 708 &[slide-in] { 709 @media (prefers-reduced-motion: no-preference) { 710 animation-name: urlbarView-action-slide-in; 711 animation-duration: 350ms; 712 animation-timing-function: var(--animation-easing-function); 713 } 714 } 715 } 716 717 .urlbarView-row[sponsored]:not([selected]) > .urlbarView-row-inner > .urlbarView-no-wrap > & { 718 opacity: 0.6; 719 } 720 721 .urlbarView-row:not([has-action], [has-url], [restyled-search]) > .urlbarView-row-inner > .urlbarView-no-wrap > & { 722 display: none; 723 } 724 725 /* If action visibility can be toggled the height should always stay the same. */ 726 .urlbarView-row[has-url]:is([type=remotetab], [sponsored]):is([selected], :hover) > .urlbarView-row-inner > .urlbarView-no-wrap > &, 727 /* This targets both rich and non-rich results, so not using the child selector here. */ 728 .urlbarView-row:is([type=search], [restyled-search]):not([selected], [show-action-text], :hover) &, 729 .urlbarView[action-override] .urlbarView-row[type=switchtab] > .urlbarView-row-inner > .urlbarView-no-wrap > & { 730 visibility: hidden; 731 width: 0; 732 margin-inline: 0; 733 /* The !important is for the switch-to-tab chiclet when action-override is set. 734 Farther down below we add extra padding on .urlbarView-switchToTab to 735 account for the tab icon. Without !important here, that padding is 736 visible even when the chiclet is hidden due to action-override. */ 737 padding-inline: 0 !important; 738 border-inline: 0; 739 } 740 741 #searchbar-new & { 742 display: none; 743 } 744 } 745 746 /* The slide-in effect is delayed ~100ms to reduce motion during result 747 composition. We set opacity: 0 at the 0% keyframe to ensure the text is not 748 seen by the user until after the delay. */ 749 @keyframes urlbarView-action-slide-in { 750 0%, 751 28.6% { 752 translate: var(--urlbarView-action-slide-in-distance); 753 opacity: 0; 754 } 755 100% { 756 translate: 0; 757 opacity: 1; 758 } 759 } 760 761 /* Switch-to-tab and Clipboard action text is styled as a chiclet. */ 762 .urlbarView-row[has-action]:is([type="switchtab"], [type="remotetab"], [type="clipboard"]) { 763 > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-action { 764 border-radius: var(--toolbarbutton-border-radius); 765 padding: 4px 8px; 766 margin-block: -2px; 767 margin-inline-start: 8px; 768 769 :root[uidensity="compact"] & { 770 padding-block: 3px; 771 772 &.urlbarView-userContext { 773 border-block-start-width: 3px; 774 } 775 } 776 777 &.urlbarView-tabGroup { 778 color: light-dark(var(--tab-group-color-pale), var(--tab-group-label-text-dark)); 779 background-color: light-dark(var(--tab-group-color), var(--tab-group-color-invert)); 780 } 781 782 /* stylelint-disable-next-line media-query-no-invalid */ 783 @media not -moz-pref("browser.urlbar.scotchBonnet.enableOverride") { 784 color: var(--urlbar-box-text-color); 785 background-color: var(--urlbar-box-focus-bgcolor); 786 787 &.urlbarView-userContext { 788 padding-top: 0; 789 } 790 } 791 792 /* stylelint-disable-next-line media-query-no-invalid */ 793 @media -moz-pref("browser.urlbar.scotchBonnet.enableOverride") { 794 -moz-context-properties: fill, fill-opacity; 795 796 border-inline: 1px solid var(--border-color-deemphasized); 797 border-block-end: 1px solid var(--border-color-deemphasized); 798 799 &.urlbarView-switchToTab { 800 padding-inline-start: calc(var(--urlbarView-favicon-width) + 8px); 801 background-image: url("chrome://browser/content/firefoxview/view-opentabs.svg"); 802 background-repeat: no-repeat; 803 background-position: 4px center; 804 background-size: var(--urlbarView-favicon-width); 805 } 806 807 &:not(.urlbarView-userContext) { 808 border-block-start: 1px solid var(--border-color-deemphasized); 809 } 810 811 &:-moz-locale-dir(rtl) { 812 background-position-x: right 4px; 813 } 814 } 815 } 816 817 /* stylelint-disable-next-line media-query-no-invalid */ 818 @media not -moz-pref("browser.urlbar.scotchBonnet.enableOverride") { 819 &:is([selected], :hover) > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-action { 820 color: var(--urlbarView-result-button-selected-color); 821 background-color: var(--urlbarView-result-button-selected-background-color); 822 } 823 } 824 } 825 826 .urlbarView:not([action-override]) .urlbarView-row[type="switchtab"], 827 .urlbarView-row[type="remotetab"]:not([selected], :hover), 828 .urlbarView-row[type="clipboard"] { 829 > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-title-separator::before { 830 /* We make the title separator transparent so it stays in the accessibility 831 tree. We want screen readers to pause between the result title and the 832 switch-to-tab action text. */ 833 opacity: 0; 834 /* -1em for the width of the \2014 character. -.4em to offset the 835 margin-inline-start already set on this element. */ 836 margin-inline-end: -1.4em; 837 } 838 } 839 840 /* URLs */ 841 842 .urlbarView-url { 843 flex-grow: 1; 844 flex-shrink: 1; 845 font-size: var(--urlbarView-small-font-size); 846 /* Increase line-height to avoid cutting overhanging glyphs due to masking on 847 the element */ 848 line-height: 1.4; 849 850 /* This targets both rich and non-rich results, so not using the child selector here. */ 851 .urlbarView-row:not([selected]) & { 852 color: var(--link-color); 853 } 854 855 .urlbarView-row:is([type="remotetab"], [sponsored]):not([selected], :hover) > .urlbarView-row-inner > &, 856 .urlbarView-row:is([show-action-text], [restyled-search]) > .urlbarView-row-inner > &, 857 .urlbarView:not([action-override]) .urlbarView-row[type="switchtab"] > .urlbarView-row-inner > & { 858 /* Use visibility:collapse instead of display:none since the latter can 859 confuse the overflow state of these elements when their content 860 changes while they're hidden (bug 1549787). */ 861 visibility: collapse; 862 } 863 } 864 865 /* Tags */ 866 867 .urlbarView-tags { 868 display: flex; 869 font-size: var(--urlbarView-small-font-size); 870 /* Increase line-height to avoid cutting overhanging glyphs due to masking on 871 the element */ 872 line-height: 1.4; 873 } 874 875 .urlbarView-tag { 876 border: 1px solid color-mix(in srgb, currentColor 30%, transparent); 877 padding: 0 4px; 878 margin-inline-start: 0.4em; 879 border-radius: var(--border-radius-small); 880 } 881 882 /* Rich suggestions */ 883 884 .urlbarView-row[rich-suggestion] > .urlbarView-row-inner { 885 align-items: center; 886 } 887 888 .urlbarView-row[rich-suggestion] > .urlbarView-row-inner > .urlbarView-favicon { 889 width: var(--urlbarView-rich-suggestion-default-icon-size); 890 height: var(--urlbarView-rich-suggestion-default-icon-size); 891 flex-basis: var(--urlbarView-rich-suggestion-default-icon-size); 892 flex-shrink: 0; 893 flex-grow: 0; 894 895 &[icon-size="16"] { 896 width: 16px; 897 height: 16px; 898 flex-basis: 16px; 899 } 900 901 &[icon-size="24"] { 902 width: 24px; 903 height: 24px; 904 flex-basis: 24px; 905 } 906 907 &[icon-size="32"] { 908 width: 32px; 909 height: 32px; 910 flex-basis: 32px; 911 } 912 913 &[icon-size="38"] { 914 width: 38px; 915 height: 38px; 916 flex-basis: 38px; 917 } 918 919 &[icon-size="52"] { 920 width: 52px; 921 height: 52px; 922 flex-basis: 52px; 923 border-radius: var(--border-radius-xsmall); 924 } 925 } 926 927 .urlbarView-row[rich-suggestion] > .urlbarView-row-inner > .urlbarView-row-body { 928 flex-grow: 1; 929 flex-shrink: 1; 930 min-width: 0; 931 932 > .urlbarView-row-body-top { 933 display: flex; 934 flex-wrap: nowrap; 935 flex-direction: row; 936 align-items: baseline; 937 938 > .urlbarView-row-body-top-no-wrap { 939 display: flex; 940 flex-wrap: nowrap; 941 flex-direction: row; 942 align-items: baseline; 943 flex-shrink: 0; 944 min-width: 0; 945 946 .urlbarView-results:not([wrap]) > & { 947 /* Limit the title (which is inside .urlbarView-row-body-top-no-wrap) to 70% 948 of the width so the URL is never completely hidden. */ 949 max-width: 70%; 950 } 951 } 952 } 953 954 > .urlbarView-row-body-description { 955 max-width: 80ch; 956 &:not(:empty) + .urlbarView-row-body-bottom:not(:empty) { 957 margin-block-start: 1em; 958 } 959 } 960 961 > :is(.urlbarView-row-body-description, .urlbarView-row-body-bottom) { 962 font-size: var(--urlbarView-small-font-size); 963 white-space: normal; 964 } 965 } 966 967 /* prettier-ignore */ 968 .urlbarView-row[rich-suggestion]:not([selected]) > .urlbarView-row-inner > .urlbarView-row-body > :is(.urlbarView-row-body-description, .urlbarView-row-body-bottom) { 969 color: var(--urlbarView-secondary-text-color); 970 } 971 972 /* Tip rows. Tip result inherits rich suggestion. */ 973 974 .urlbarView-row[type="tip"] { 975 padding-block: 18px; 976 border-block: 0; 977 border-radius: 0; 978 979 &:not(:last-child) { 980 border-bottom: 1px solid var(--urlbarView-separator-color); 981 margin-bottom: 4px; 982 } 983 984 &:not(:first-child) { 985 border-top: 1px solid var(--urlbarView-separator-color); 986 margin-top: 4px; 987 } 988 989 /* For tips with row labels, move the entire row down by an additional 990 var(--urlbarView-labeled-tip-margin-top-extra) so there's more space 991 between the tip's top border and the label. They're too close otherwise. 992 The row label must also be adjusted; see the row label rules. */ 993 &[label] { 994 margin-top: calc(var(--urlbarView-labeled-row-margin-top) + var(--urlbarView-labeled-tip-margin-top-extra)); 995 } 996 997 > .urlbarView-row-inner { 998 min-height: 32px; 999 align-items: center; 1000 1001 /* Add space between the tip title (and the rest of row-inner) and its 1002 button. */ 1003 margin-inline-end: 1.8em; 1004 1005 > .urlbarView-row-body > .urlbarView-row-body-top > .urlbarView-row-body-top-no-wrap { 1006 flex-shrink: unset; 1007 1008 > .urlbarView-title { 1009 white-space: normal; 1010 } 1011 1012 > :not(.urlbarView-title) { 1013 display: none; 1014 } 1015 } 1016 1017 > .urlbarView-row-body > .urlbarView-row-body-top > .urlbarView-url { 1018 display: none; 1019 } 1020 1021 > .urlbarView-row-body > .urlbarView-row-body-description { 1022 &:not(:empty) { 1023 /* Keep padding so the entire selected outline for learn more link */ 1024 padding-block: 4px; 1025 } 1026 1027 > a { 1028 white-space: nowrap; 1029 color: currentColor; 1030 } 1031 1032 > a[selected] { 1033 border-radius: var(--border-radius-small); 1034 outline: var(--focus-outline); 1035 outline-offset: var(--link-focus-outline-offset); 1036 } 1037 } 1038 } 1039 1040 > .urlbarView-row-buttons { 1041 /* Move the buttons away from the row edge for better visual balance. */ 1042 padding-inline-end: var(--space-large); 1043 1044 > .urlbarView-button, 1045 > .urlbarView-splitbutton { 1046 /* Horizontal space between buttons */ 1047 margin-inline: var(--space-small); 1048 /* Vertical space between buttons when the row is narrow and the buttons wrap */ 1049 margin-block: var(--space-small); 1050 } 1051 1052 > .urlbarView-splitbutton > .urlbarView-splitbutton-dropmarker { 1053 /* The dropmarker is a `.urlbarView-button` so it gets the usual 4px inline 1054 margin. Remove it so it doesn't add to the splitbutton margin. */ 1055 margin-inline-end: 0; 1056 } 1057 } 1058 1059 .urlbarView-results[wrap] > & { 1060 display: block; 1061 text-align: end; 1062 1063 > .urlbarView-row-inner { 1064 display: flex; 1065 text-align: start; 1066 } 1067 1068 &[tip-type="dismissalAcknowledgment"] { 1069 padding-block: 6px; 1070 1071 &:last-child { 1072 padding-block-end: max(0px, 6px - var(--urlbarView-results-padding)); 1073 } 1074 } 1075 } 1076 } 1077 1078 /* Sponsored Firefox Suggest rows */ 1079 1080 .urlbarView-row[type$="_adm_sponsored"][icon-size="16"] > .urlbarView-row-inner { 1081 /* Keep the status quo before these rows were rich suggestions, where the row 1082 height is roughly the same as usual rows. */ 1083 padding-block: 0; 1084 } 1085 1086 /* Other Firefox Suggest rows */ 1087 1088 .urlbarView-row[type$="_amo"][icon-size="24"] > .urlbarView-row-inner > .urlbarView-favicon { 1089 padding: calc((var(--urlbarView-top-pick-large-icon-box-size) - 24px) / 2); 1090 background-color: var(--urlbar-box-focus-bgcolor); 1091 border-radius: var(--border-radius-xsmall); 1092 } 1093 1094 .urlbarView-row[type$="_amo"][icon-size="24"]:is([selected], :hover) > .urlbarView-row-inner > .urlbarView-favicon { 1095 background-color: var(--urlbarView-result-button-selected-background-color); 1096 } 1097 1098 .urlbarView-row[type$="_vpn"][icon-size="32"] > .urlbarView-row-inner > .urlbarView-favicon { 1099 padding: calc((var(--urlbarView-top-pick-large-icon-box-size) - 32px) / 2); 1100 } 1101 1102 .urlbarView-row[dynamicType="weather"], 1103 .urlbarView-row[type="weather"] { 1104 /* Use the colors in the icon SVG files except in HCM and when the row is 1105 selected. Note that the SVG uses light or dark colors as appropriate. */ 1106 &:not([selected]) > .urlbarView-row-inner > .urlbarView-favicon { 1107 @media not (prefers-contrast) { 1108 -moz-context-properties: unset; 1109 } 1110 } 1111 1112 /* Map AccuWeather icon IDs to our icons. These IDs come straight from the 1113 AccuWeather API response via Merino. These rules apply to both the older 1114 weather UI treatments ("simpler" and "full", which use a dynamic result) 1115 and the new treatment ("simplest", which is a standard rich suggestion). */ 1116 /* prettier-ignore */ 1117 > .urlbarView-row-inner > .urlbarView-dynamic-weather-currentConditions > .urlbarView-dynamic-weather-currentTemperature > .urlbarView-dynamic-weather-weatherIcon, 1118 > .urlbarView-row-inner > .urlbarView-favicon { 1119 /* icon-variation="1" is "Sunny", which we'll use as the default to ensure an 1120 image is always visible. We don't expect AccuWeather to ever include an 1121 invalid icon ID, but they may add new ones that aren't recognized by this 1122 version of Firefox for example. */ 1123 content: url("chrome://browser/skin/weather/sunny.svg"); 1124 &[icon-variation="2"] { 1125 content: url("chrome://browser/skin/weather/mostly-sunny.svg"); 1126 } 1127 &:is([icon-variation="3"], [icon-variation="4"], [icon-variation="6"]) { 1128 content: url("chrome://browser/skin/weather/partly-sunny.svg"); 1129 } 1130 &[icon-variation="5"] { 1131 content: url("chrome://browser/skin/weather/hazy-sunshine.svg"); 1132 } 1133 &:is([icon-variation="7"], [icon-variation="8"]) { 1134 content: url("chrome://browser/skin/weather/cloudy.svg"); 1135 } 1136 &[icon-variation="11"] { 1137 content: url("chrome://browser/skin/weather/fog.svg"); 1138 } 1139 &[icon-variation="12"] { 1140 content: url("chrome://browser/skin/weather/showers.svg"); 1141 } 1142 &:is([icon-variation="13"], [icon-variation="14"]) { 1143 content: url("chrome://browser/skin/weather/mostly-cloudy-with-showers.svg"); 1144 } 1145 &[icon-variation="15"] { 1146 content: url("chrome://browser/skin/weather/thunderstorms.svg"); 1147 } 1148 &:is([icon-variation="16"], [icon-variation="17"]) { 1149 content: url("chrome://browser/skin/weather/mostly-cloudy-with-thunderstorms.svg"); 1150 } 1151 &[icon-variation="18"] { 1152 content: url("chrome://browser/skin/weather/rain.svg"); 1153 } 1154 &:is([icon-variation="19"], [icon-variation="20"], [icon-variation="25"]) { 1155 content: url("chrome://browser/skin/weather/flurries.svg"); 1156 } 1157 &[icon-variation="21"] { 1158 content: url("chrome://browser/skin/weather/partly-sunny-with-flurries.svg"); 1159 } 1160 &:is([icon-variation="22"], [icon-variation="23"]) { 1161 content: url("chrome://browser/skin/weather/snow.svg"); 1162 } 1163 &:is([icon-variation="24"], [icon-variation="31"]) { 1164 content: url("chrome://browser/skin/weather/ice.svg"); 1165 } 1166 &:is([icon-variation="26"], [icon-variation="29"]) { 1167 content: url("chrome://browser/skin/weather/freezing-rain.svg"); 1168 } 1169 &[icon-variation="30"] { 1170 content: url("chrome://browser/skin/weather/hot.svg"); 1171 } 1172 &[icon-variation="32"] { 1173 content: url("chrome://browser/skin/weather/windy.svg"); 1174 } 1175 &[icon-variation="33"] { 1176 content: url("chrome://browser/skin/weather/night-clear.svg"); 1177 } 1178 &:is([icon-variation="34"], [icon-variation="35"], [icon-variation="36"], [icon-variation="38"]) { 1179 content: url("chrome://browser/skin/weather/night-mostly-clear.svg"); 1180 } 1181 &[icon-variation="37"] { 1182 content: url("chrome://browser/skin/weather/night-hazy-moonlight.svg"); 1183 } 1184 &:is([icon-variation="39"], [icon-variation="40"]) { 1185 content: url("chrome://browser/skin/weather/night-partly-cloudy-with-showers.svg"); 1186 } 1187 &:is([icon-variation="41"], [icon-variation="42"]) { 1188 content: url("chrome://browser/skin/weather/night-partly-cloudy-with-thunderstorms.svg"); 1189 } 1190 &:is([icon-variation="43"], [icon-variation="44"]) { 1191 content: url("chrome://browser/skin/weather/night-mostly-cloudy-with-flurries.svg"); 1192 } 1193 } 1194 } 1195 1196 /* Actions */ 1197 .urlbarView-results[actionmode] { 1198 white-space: wrap; 1199 1200 > .urlbarView-row { 1201 display: inline-flex; 1202 } 1203 } 1204 1205 /* To align the label and action button */ 1206 .urlbarView-row[secondary-action] { 1207 flex-direction: column; 1208 align-items: flex-start; 1209 } 1210 1211 .urlbarView-actions-container { 1212 margin-inline-start: calc( 1213 var(--urlbarView-item-inline-padding) + var(--urlbarView-favicon-margin-start) + var(--urlbarView-favicon-width) + var(--urlbarView-icon-margin-end) 1214 ); 1215 margin-block-end: var(--urlbarView-item-block-padding); 1216 } 1217 1218 .urlbarView-action-btn { 1219 font-size: smaller; 1220 font-weight: var(--font-weight-semibold); 1221 border-radius: var(--toolbarbutton-border-radius); 1222 border: 1px solid transparent; 1223 padding: 0.4em 0.6em; 1224 display: inline-flex; 1225 align-items: center; 1226 background-color: var(--urlbarView-action-button-background-color); 1227 margin-inline-end: var(--space-large); 1228 1229 > img { 1230 width: 16px; 1231 height: 16px; 1232 margin-inline-end: 0.4em; 1233 -moz-context-properties: fill, fill-opacity; 1234 } 1235 1236 &:hover { 1237 background-color: var(--urlbarView-action-button-hover-background-color); 1238 } 1239 1240 &[selected], 1241 &:hover:active { 1242 outline: var(--focus-outline); 1243 } 1244 1245 &.urlbarView-userContext { 1246 border-top-color: var(--identity-tab-color); 1247 } 1248 1249 .urlbarView[action-override] &[data-action="tabswitch"] { 1250 display: none; 1251 } 1252 1253 &[data-action^="tabgroup-"] { 1254 color: light-dark(var(--tab-group-color-pale), var(--tab-group-label-text-dark)); 1255 background-color: light-dark(var(--tab-group-color), var(--tab-group-color-invert)); 1256 max-width: 30%; 1257 1258 /* Add offset to the focus / selection indicator as the outline color could 1259 be close to the group color. */ 1260 outline-offset: 1px; 1261 margin-inline-start: 1px; 1262 1263 &:hover { 1264 opacity: 0.8; 1265 } 1266 1267 > .urlbarView-action-btn-label { 1268 overflow: hidden; 1269 text-overflow: ellipsis; 1270 } 1271 } 1272 } 1273 1274 /* Suggest realtime opt-in */ 1275 1276 .urlbarView-row[rich-suggestion][tip-type="realtime_opt_in"] { 1277 /* `margin-block-end` is large to give enough spacing between the opt-in and the 1278 row label in the next row. */ 1279 margin-block: var(--urlbarView-item-block-padding) calc(5 * var(--urlbarView-item-block-padding)); 1280 padding-block: 0; 1281 border-block: none; 1282 border-radius: var(--border-radius-medium); 1283 1284 @media not (prefers-contrast) { 1285 background-color: color-mix(in srgb, var(--button-background-color) 30%, transparent); 1286 } 1287 1288 > .urlbarView-row-inner { 1289 padding: 0; 1290 1291 > .urlbarView-favicon { 1292 width: 98px; 1293 flex-basis: 98px; 1294 height: auto; 1295 align-self: stretch; 1296 1297 margin-inline: 0; 1298 border-start-start-radius: var(--border-radius-medium); 1299 border-end-start-radius: var(--border-radius-medium); 1300 1301 background-color: light-dark(#ddcfff, #4e2e9d); 1302 fill: none; 1303 1304 @media (prefers-contrast) { 1305 background-color: currentColor; 1306 fill: currentColor; 1307 } 1308 } 1309 1310 > .urlbarView-row-body { 1311 padding: var(--space-xlarge); 1312 1313 > .urlbarView-row-body-top > .urlbarView-row-body-top-no-wrap > .urlbarView-title { 1314 font-weight: var(--heading-font-weight); 1315 } 1316 } 1317 } 1318 1319 .urlbarView-results[wrap] > & { 1320 > .urlbarView-row-inner { 1321 padding: var(--space-large); 1322 1323 > .urlbarView-favicon { 1324 border-radius: var(--border-radius-medium); 1325 } 1326 } 1327 1328 > .urlbarView-row-buttons { 1329 /* Should match `padding-inline-end` of `.urlbarView-row-buttons` in tips. */ 1330 padding-block-end: var(--space-large); 1331 } 1332 } 1333 } 1334 1335 /* Basic style for Realtime suggestions */ 1336 1337 .urlbarView-realtime-root { 1338 --green-status-color: light-dark(var(--color-green-60), var(--color-green-20)); 1339 --red-status-color: light-dark(var(--color-red-70), var(--color-red-40)); 1340 --violet-bg-color: light-dark(var(--color-violet-0), var(--color-violet-80)); 1341 --violet-fg-color: light-dark(var(--color-violet-60), var(--color-violet-10)); 1342 1343 @media (prefers-contrast) { 1344 --violet-bg-color: var(--urlbar-box-focus-bgcolor); 1345 --violet-fg-color: currentColor; 1346 } 1347 1348 align-items: center; 1349 1350 /* Realtime suggestions can contain many items, which should always wrap. */ 1351 flex-wrap: wrap; 1352 1353 /* Remove the usual inner padding. Each item in the row will have its own. */ 1354 padding: 0; 1355 1356 > .urlbarView-realtime-item { 1357 display: flex; 1358 align-items: center; 1359 1360 /* This should match the radius on `.urlbarView-row`. Only visible when there 1361 are multiple items in a row. */ 1362 border-radius: calc(var(--urlbarView-row-gutter) + var(--toolbarbutton-border-radius)); 1363 1364 /* Inline spacing between multiple items in a row */ 1365 margin-inline-end: var(--space-small); 1366 1367 /* The block and inline-start padding should match the normal inner inline 1368 padding we removed above, in order to keep the first item's image aligned 1369 with the text and images in other rows. */ 1370 padding: var(--urlbarView-item-inline-padding); 1371 padding-inline-end: var(--space-large); 1372 1373 .urlbarView-realtime-root:not([selectable]) > &:not([selected]):hover { 1374 background-color: var(--urlbarView-hover-background); 1375 } 1376 1377 &[selected] { 1378 color: var(--urlbarView-highlight-color); 1379 background-color: var(--urlbarView-highlight-background); 1380 } 1381 1382 > .urlbarView-realtime-image-container { 1383 display: flex; 1384 align-items: center; 1385 justify-content: center; 1386 width: var(--urlbarView-top-pick-large-icon-box-size); 1387 height: var(--urlbarView-top-pick-large-icon-box-size); 1388 margin-inline-end: var(--space-medium); 1389 border: 1px solid transparent; 1390 border-radius: var(--border-radius-small); 1391 1392 fill: currentColor; 1393 fill-opacity: var(--urlbar-icon-fill-opacity); 1394 -moz-context-properties: fill, fill-opacity; 1395 1396 > .urlbarView-realtime-image { 1397 width: 36px; 1398 height: auto; 1399 max-height: 36px; 1400 } 1401 } 1402 1403 > .urlbarView-realtime-description { 1404 display: flex; 1405 flex-direction: column; 1406 text-align: start; 1407 grid-row-gap: var(--space-xsmall); 1408 1409 > .urlbarView-realtime-description-bottom { 1410 display: flex; 1411 align-items: center; 1412 font-size: var(--urlbarView-small-font-size); 1413 color: var(--urlbarView-secondary-text-color); 1414 } 1415 1416 > .urlbarView-realtime-description-top > .urlbarView-realtime-description-separator-dot, 1417 > .urlbarView-realtime-description-top > .urlbarView-realtime-description-separator-dash, 1418 > .urlbarView-realtime-description-bottom > .urlbarView-realtime-description-separator-dot, 1419 > .urlbarView-realtime-description-bottom > .urlbarView-realtime-description-separator-dash { 1420 /* stylelint-disable-next-line max-nesting-depth */ 1421 &::before { 1422 margin-inline: var(--space-xsmall); 1423 display: inline; 1424 } 1425 1426 /* stylelint-disable-next-line max-nesting-depth */ 1427 &:has(+ span:empty) { 1428 display: none; 1429 } 1430 } 1431 1432 > .urlbarView-realtime-description-top > .urlbarView-realtime-description-separator-dot, 1433 > .urlbarView-realtime-description-bottom > .urlbarView-realtime-description-separator-dot { 1434 /* stylelint-disable-next-line max-nesting-depth */ 1435 &::before { 1436 content: "·"; 1437 } 1438 } 1439 1440 > .urlbarView-realtime-description-top > .urlbarView-realtime-description-separator-dash, 1441 > .urlbarView-realtime-description-bottom > .urlbarView-realtime-description-separator-dash { 1442 /* stylelint-disable-next-line max-nesting-depth */ 1443 &::before { 1444 content: "–"; 1445 } 1446 } 1447 } 1448 } 1449 } 1450 1451 /* Market suggestions specific */ 1452 1453 .urlbarView-row[dynamicType="realtime-market"] > .urlbarView-realtime-root > .urlbarView-realtime-item { 1454 --market-image-bg-color: var(--urlbar-box-focus-bgcolor); 1455 --market-image-down-bg-color: light-dark(var(--color-red-0), var(--color-red-90)); 1456 --market-image-up-bg-color: light-dark(var(--color-green-0), var(--color-green-90)); 1457 1458 > .urlbarView-realtime-image-container { 1459 background-color: var(--market-image-bg-color); 1460 1461 &[is-arrow] { 1462 border-color: color-mix(in srgb, currentColor 10%, transparent); 1463 1464 .urlbarView-realtime-item[change="down"] > & { 1465 fill: var(--red-status-color); 1466 border-color: color-mix(in srgb, var(--red-status-color) 10%, transparent); 1467 background-color: var(--market-image-down-bg-color); 1468 } 1469 .urlbarView-realtime-item[change="up"] > & { 1470 fill: var(--green-status-color); 1471 border-color: color-mix(in srgb, var(--green-status-color) 10%, transparent); 1472 background-color: var(--market-image-up-bg-color); 1473 } 1474 1475 > .urlbarView-realtime-image { 1476 width: 20px; 1477 height: 20px; 1478 } 1479 } 1480 } 1481 1482 > .urlbarView-realtime-description { 1483 > .urlbarView-realtime-description-top { 1484 > .urlbarView-market-name { 1485 font-weight: var(--font-weight-semibold); 1486 } 1487 } 1488 1489 > .urlbarView-realtime-description-bottom { 1490 > .urlbarView-market-todays-change-perc { 1491 font-weight: var(--font-weight-semibold); 1492 } 1493 1494 > .urlbarView-market-last-price { 1495 /* This value is a string like "$123.45 USD". The "USD" part should be small 1496 caps and the rest should be normal size. */ 1497 text-transform: lowercase; 1498 font-variant-caps: small-caps; 1499 } 1500 } 1501 1502 .urlbarView-row:not([selected]) 1503 > .urlbarView-realtime-root 1504 > .urlbarView-realtime-item[change="up"]:not([selected]) 1505 > & 1506 > .urlbarView-realtime-description-bottom 1507 > .urlbarView-market-todays-change-perc { 1508 color: var(--green-status-color); 1509 } 1510 1511 .urlbarView-row:not([selected]) 1512 > .urlbarView-realtime-root 1513 > .urlbarView-realtime-item[change="down"]:not([selected]) 1514 > & 1515 > .urlbarView-realtime-description-bottom 1516 > .urlbarView-market-todays-change-perc { 1517 color: var(--red-status-color); 1518 } 1519 } 1520 } 1521 1522 /* Yelp realtime suggestions specific */ 1523 1524 .urlbarView-row[dynamicType="realtime-yelpRealtime"] > .urlbarView-realtime-root > .urlbarView-realtime-item { 1525 --star-size: 12px; 1526 1527 > .urlbarView-realtime-image-container > .urlbarView-realtime-image { 1528 width: 52px; 1529 height: 52px; 1530 flex-basis: 52px; 1531 } 1532 1533 > .urlbarView-realtime-description { 1534 > .urlbarView-realtime-description-top > .urlbarView-yelpRealtime-title { 1535 font-weight: var(--heading-font-weight); 1536 } 1537 1538 > .urlbarView-realtime-description-bottom { 1539 > .urlbarView-yelpRealtime-description-popularity-star { 1540 display: inline-block; 1541 width: var(--star-size); 1542 height: var(--star-size); 1543 background-image: url("chrome://global/skin/icons/rating-star.svg"); 1544 background-position: center; 1545 background-repeat: no-repeat; 1546 background-size: var(--star-size) var(--star-size); 1547 margin-inline-end: 0.3ch; 1548 1549 fill: var(--icon-color); 1550 -moz-context-properties: fill; 1551 } 1552 1553 .urlbarView-row:not([selected]) 1554 > .urlbarView-realtime-root 1555 > .urlbarView-realtime-item[state="open"]:not([selected]) 1556 > .urlbarView-realtime-description 1557 > & 1558 > .urlbarView-yelpRealtime-description-business-hours 1559 > span { 1560 color: var(--green-status-color); 1561 } 1562 .urlbarView-row:not([selected]) 1563 > .urlbarView-realtime-root 1564 > .urlbarView-realtime-item[state="closed"]:not([selected]) 1565 > .urlbarView-realtime-description 1566 > & 1567 > .urlbarView-yelpRealtime-description-business-hours 1568 > span { 1569 color: var(--red-status-color); 1570 } 1571 } 1572 } 1573 } 1574 1575 /* Flight status suggestions specific */ 1576 1577 .urlbarView-row[dynamicType="realtime-flightStatus"] > .urlbarView-realtime-root > .urlbarView-realtime-item { 1578 > .urlbarView-realtime-image-container { 1579 --airline-fallback-icon-color: #bac2ca; 1580 1581 border-color: color-mix(in srgb, currentColor 10%, transparent); 1582 background-color: var(--urlbar-box-focus-bgcolor); 1583 1584 &[backgroundImageId] { 1585 background-position: center; 1586 -moz-context-properties: fill, stroke; 1587 fill: var(--airline-color, currentColor); 1588 stroke: var(--airline-color, currentColor); 1589 } 1590 1591 &[backgroundImageId="0"] { 1592 background-image: url(chrome://browser/skin/urlbar/flight-inflight-progress-0.svg); 1593 } 1594 1595 &[backgroundImageId="1"] { 1596 background-image: url(chrome://browser/skin/urlbar/flight-inflight-progress-1.svg); 1597 } 1598 1599 &[backgroundImageId="2"] { 1600 background-image: url(chrome://browser/skin/urlbar/flight-inflight-progress-2.svg); 1601 } 1602 1603 &[backgroundImageId="3"] { 1604 background-image: url(chrome://browser/skin/urlbar/flight-inflight-progress-3.svg); 1605 } 1606 1607 &[backgroundImageId="4"] { 1608 background-image: url(chrome://browser/skin/urlbar/flight-inflight-progress-4.svg); 1609 } 1610 1611 &[hasForegroundImage] { 1612 /* Move up the progress image if exists */ 1613 background-position-y: bottom 12px; 1614 /* Move the foreground image to the end corner */ 1615 display: flex; 1616 justify-content: end; 1617 align-items: end; 1618 } 1619 1620 > .urlbarView-realtime-image[fallback] { 1621 width: 26px; 1622 height: 26px; 1623 flex-basis: 26px; 1624 fill: var(--airline-fallback-icon-color); 1625 } 1626 } 1627 1628 > .urlbarView-realtime-description { 1629 > .urlbarView-realtime-description-top > .urlbarView-flightStatus-time { 1630 font-weight: var(--font-weight-semibold); 1631 margin-inline-end: var(--space-small); 1632 } 1633 1634 > .urlbarView-realtime-description-bottom { 1635 > .urlbarView-flightStatus-status { 1636 font-weight: var(--font-weight-semibold); 1637 } 1638 1639 .urlbarView-row:not([selected]) 1640 > .urlbarView-realtime-root 1641 > .urlbarView-realtime-item:is([status="ontime"], [status="inflight"], [status="arrived"]):not([selected]) 1642 > .urlbarView-realtime-description 1643 > & 1644 > .urlbarView-flightStatus-status { 1645 color: var(--green-status-color); 1646 } 1647 1648 .urlbarView-row:not([selected]) 1649 > .urlbarView-realtime-root 1650 > .urlbarView-realtime-item:is([status="cancelled"], [status="delayed"]):not([selected]) 1651 > .urlbarView-realtime-description 1652 > & 1653 > .urlbarView-flightStatus-status { 1654 color: var(--red-status-color); 1655 } 1656 } 1657 } 1658 } 1659 1660 /* Realtime sports suggestions */ 1661 1662 .urlbarView-row[dynamicType="realtime-sports"] > .urlbarView-realtime-root > .urlbarView-realtime-item { 1663 > .urlbarView-realtime-image-container[is-fallback] { 1664 flex-direction: column; 1665 1666 background-color: var(--violet-bg-color); 1667 background-position: center; 1668 background-repeat: no-repeat; 1669 border-color: color-mix(in srgb, currentColor 10%, transparent); 1670 color: var(--violet-fg-color); 1671 fill: var(--violet-fg-color); 1672 -moz-context-properties: fill; 1673 1674 > .urlbarView-sports-scheduled-date-chiclet-day { 1675 font-size: 1.25em; 1676 } 1677 1678 /* Fallback icons per sport but only for games not in the future */ 1679 .urlbarView-realtime-item:not([status="scheduled"]) > & { 1680 .urlbarView-realtime-item[sport="NBA"] > &, 1681 .urlbarView-realtime-item[sport="NHL"] > &, 1682 .urlbarView-realtime-item[sport="NFL"] > & { 1683 /* stylelint-disable-next-line max-nesting-depth */ 1684 > .urlbarView-sports-scheduled-date-chiclet-day, 1685 > .urlbarView-sports-scheduled-date-chiclet-month { 1686 display: none; 1687 } 1688 } 1689 .urlbarView-realtime-item[sport="NBA"] > & { 1690 background-image: url("chrome://browser/skin/urlbar/sports-basketball.svg"); 1691 } 1692 .urlbarView-realtime-item[sport="NHL"] > & { 1693 background-image: url("chrome://browser/skin/urlbar/sports-hockey.svg"); 1694 } 1695 .urlbarView-realtime-item[sport="NFL"] > & { 1696 background-image: url("chrome://browser/skin/urlbar/sports-american-football.svg"); 1697 } 1698 } 1699 } 1700 1701 > .urlbarView-realtime-description { 1702 > .urlbarView-realtime-description-top { 1703 > .urlbarView-sports-team-names { 1704 font-weight: var(--font-weight-bold); 1705 } 1706 1707 > .urlbarView-sports-score { 1708 font-weight: var(--font-weight-bold); 1709 margin-inline-start: var(--space-xsmall); 1710 } 1711 } 1712 1713 > .urlbarView-realtime-description-bottom { 1714 > .urlbarView-sports-status { 1715 color: var(--green-status-color); 1716 font-weight: var(--font-weight-bold); 1717 } 1718 } 1719 } 1720 } 1721 1722 /* Search one-offs */ 1723 1724 #urlbar .search-one-offs:not([hidden]) { 1725 display: flex; 1726 align-items: start; 1727 padding-block: 10px; 1728 flex-wrap: wrap; 1729 } 1730 1731 .urlbarView:not([noresults]) > .search-one-offs:not([hidden]) { 1732 border-top: 1px solid var(--urlbarView-separator-color); 1733 } 1734 1735 :root[uidensity="touch"] #urlbar .search-one-offs:not([hidden]) { 1736 padding-block: 15px; 1737 } 1738 1739 #urlbar .search-panel-one-offs-container { 1740 /* Make sure horizontally we can fit four buttons, empty space, settings. */ 1741 min-width: calc(4 * /* one-off with end margin */ 40px + /* settings with start margin */ 56px); 1742 } 1743 1744 #urlbar .search-panel-header { 1745 padding: 0; 1746 min-height: 28px; 1747 display: flex; 1748 flex-direction: column; 1749 justify-content: center; 1750 } 1751 1752 #urlbar .search-panel-one-offs-header-label { 1753 white-space: nowrap; 1754 margin: 0; 1755 padding-inline: var(--urlbarView-item-inline-padding) 18px; 1756 } 1757 1758 #urlbar .searchbar-engine-one-off-item { 1759 min-width: 28px; 1760 height: 28px; 1761 margin-inline: 0 12px; 1762 border-radius: var(--toolbarbutton-border-radius); 1763 } 1764 1765 #urlbar .searchbar-engine-one-off-item:last-child { 1766 /* This applies to both the last one-off and the compact settings button */ 1767 margin-inline-end: 0; 1768 } 1769 1770 #urlbar .search-setting-button { 1771 /* Force empty space before the button */ 1772 margin-inline-start: calc(32px - /* settings start padding */ 8px); 1773 } 1774 1775 .urlbarView-row[source="bookmarks"] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-favicon, 1776 #urlbar-engine-one-off-item-bookmarks { 1777 list-style-image: url("chrome://browser/skin/bookmark.svg"); 1778 fill: var(--toolbarbutton-icon-fill-attention); 1779 fill-opacity: 1; 1780 -moz-context-properties: fill, fill-opacity; 1781 } 1782 1783 .urlbarView-row[source="tabs"] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-favicon, 1784 #urlbar-engine-one-off-item-tabs { 1785 list-style-image: url("chrome://browser/skin/tab.svg"); 1786 -moz-context-properties: fill, fill-opacity; 1787 fill: currentColor; 1788 fill-opacity: var(--urlbar-icon-fill-opacity); 1789 } 1790 1791 .urlbarView-row[source="history"] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-favicon, 1792 #urlbar-engine-one-off-item-history { 1793 list-style-image: url("chrome://browser/skin/history.svg"); 1794 -moz-context-properties: fill, fill-opacity; 1795 fill: currentColor; 1796 fill-opacity: var(--urlbar-icon-fill-opacity); 1797 } 1798 1799 .urlbarView-row[source="actions"] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-favicon, 1800 #urlbar-engine-one-off-item-actions { 1801 list-style-image: url("chrome://browser/skin/quickactions.svg"); 1802 -moz-context-properties: fill, fill-opacity; 1803 fill: currentColor; 1804 fill-opacity: var(--urlbar-icon-fill-opacity); 1805 } 1806 1807 /** 1808 * We remove the blue fill from the bookmark icon when it is selected. We use 1809 * a blue color as the selection background-color in some instances (Linux with 1810 * blue system color; fallback for third-party themes) and we want to ensure 1811 * contrast. 1812 */ 1813 .urlbarView-row[source="bookmarks"][selected] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-favicon, 1814 #urlbar-engine-one-off-item-bookmarks[selected] { 1815 fill: currentColor; 1816 fill-opacity: var(--urlbar-icon-fill-opacity); 1817 } 1818 1819 /* search bar popup */ 1820 1821 #PopupSearchAutoComplete { 1822 --panel-color: var(--toolbar-field-focus-color); 1823 --panel-background: var(--toolbar-field-focus-background-color); 1824 --panel-border-color: var(--arrowpanel-border-color); 1825 } 1826 1827 #PopupSearchAutoComplete::part(content) { 1828 --panel-padding: var(--panel-subview-body-padding); 1829 /* NOTE(emilio): Once bug 1551637 is fixed we don't need to use block layout 1830 * for this (though it doesn't really hurt) */ 1831 display: block; 1832 } 1833 1834 @media not (prefers-contrast) { 1835 #PopupSearchAutoComplete::part(content) { 1836 /* Remove the top border since the panel is flush with the input. */ 1837 border-top-width: 0; 1838 } 1839 } 1840 1841 #PopupSearchAutoComplete .autocomplete-richlistitem[selected] { 1842 background: var(--urlbarView-highlight-background); 1843 color: var(--urlbarView-highlight-color); 1844 }