1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@namespace html url("http://www.w3.org/1999/xhtml");
:root {
--urlbar-container-padding: 1px;
--urlbar-margin-inline: 5px;
--urlbar-padding-block: 4px;
}
#urlbar[actiontype="switchtab"][action-override] > .urlbar-input-container > #urlbar-label-box,
#urlbar:not([actiontype="switchtab"], [actiontype="extension"], [searchmode]) > .urlbar-input-container > #urlbar-label-box,
#urlbar:not([actiontype="switchtab"]) > .urlbar-input-container > #urlbar-label-box > #urlbar-label-switchtab,
#urlbar:not([actiontype="extension"]) > .urlbar-input-container > #urlbar-label-box > #urlbar-label-extension,
#urlbar[searchmode][breakout-extend] > .urlbar-input-container > #urlbar-label-box,
#urlbar:not([searchmode]) > .urlbar-input-container > #urlbar-label-box > #urlbar-label-search-mode,
#urlbar[breakout-extend] > .urlbar-input-container > #urlbar-label-box > #urlbar-label-search-mode,
.urlbar-input-container[pageproxystate="invalid"] > #page-action-buttons > .urlbar-page-action,
#identity-box.chromeUI ~ #page-action-buttons > .urlbar-page-action:not(#star-button-box),
#urlbar[usertyping] > .urlbar-input-container > #page-action-buttons > #urlbar-zoom-button,
#urlbar:not([usertyping]) > .urlbar-input-container > .urlbar-go-button,
#urlbar:not([focused]) > .urlbar-input-container > .urlbar-go-button,
#urlbar-revert-button-container {
display: none;
}
/* When rich suggestions are enabled the urlbar identity icon is given extra padding to
* align the results and urlbar text */
/* stylelint-disable-next-line media-query-no-invalid */
@media -moz-pref("browser.urlbar.richSuggestions.featureGate") {
#identity-box[pageproxystate="invalid"] > .identity-box-button {
padding-inline: calc(6px + var(--urlbar-icon-padding));
}
}
#urlbar-container,
#search-container {
padding-block: var(--urlbar-padding-block);
margin-inline: var(--urlbar-margin-inline);
:root[uidensity="touch"] & {
padding-block: 5px;
}
}
#urlbar {
display: flex;
flex-direction: row;
flex: 1;
box-sizing: border-box;
will-change: translate;
/* Reset UA popover rules */
width: initial;
height: initial;
inset: auto;
border: none;
padding: initial;
overflow: initial;
color: initial;
background-color: initial;
}
#urlbar,
#searchbar {
/* Setting a min-width to let the location & search bars maintain a constant
* width in case they haven't been resized manually. (bug 965772) */
min-width: 1px;
min-height: var(--urlbar-min-height);
text-shadow: none;
color: var(--toolbar-field-color);
/**
* System colors and widgets are set based on toolbar color. Since toolbar
* fields can be styled differently from the toolbar, we need to use the
* correct color scheme in toolbar fields.
*/
:root[lwt-toolbar-field="light"] & {
color-scheme: light;
}
:root[lwt-toolbar-field="dark"] & {
color-scheme: dark;
}
}
#urlbar[focused],
#searchbar:focus-within {
:root[lwt-toolbar-field-focus="light"] & {
color-scheme: light;
}
:root[lwt-toolbar-field-focus="dark"] & {
color-scheme: dark;
}
}
#urlbar-background,
#searchbar {
background-color: var(--toolbar-field-background-color);
background-clip: border-box;
border: 1px solid var(--toolbar-field-border-color);
border-radius: var(--toolbarbutton-border-radius);
}
.urlbar-input-container,
#searchbar {
border-radius: var(--toolbarbutton-border-radius);
overflow: clip;
}
.urlbar-input,
#urlbar-scheme,
.searchbar-textbox {
flex: 1;
background-color: transparent;
color: inherit;
border: none;
margin: 0;
padding: 0;
outline: none;
}
.urlbar-input {
mask-repeat: no-repeat;
unicode-bidi: plaintext;
text-align: match-parent;
/* Align URLs to the right in RTL mode. */
&:-moz-locale-dir(rtl) {
text-align: right !important;
}
/* Make sure that the location bar's alignment changes according
to the input box direction if the user switches the text direction using
cmd_switchTextDirection (which applies a dir attribute to the <input>). */
&[dir="ltr"]:-moz-locale-dir(rtl) {
text-align: left !important;
}
&[dir="rtl"]:-moz-locale-dir(ltr) {
text-align: right !important;
}
#urlbar:not([focused])[domaindir="ltr"] > .urlbar-input-container > .urlbar-input-box > & {
direction: ltr;
unicode-bidi: embed;
}
/* The following rules apply overflow masks to the unfocused urlbar
This mask may be overriden when a Contextual Feature Recommendation is shown. */
#urlbar:not([focused])[textoverflow="both"] > .urlbar-input-container > .urlbar-input-box > & {
mask-image: linear-gradient(to right, transparent, black 3ch, black calc(100% - 3ch), transparent);
}
#urlbar:not([focused])[textoverflow="right"] > .urlbar-input-container > .urlbar-input-box > & {
mask-image: linear-gradient(to left, transparent, black 3ch);
}
#urlbar:not([focused])[textoverflow="left"] > .urlbar-input-container > .urlbar-input-box > & {
mask-image: linear-gradient(to right, transparent, black 3ch);
}
#urlbar:not([focused])[textoverflow="left"][domaindir="rtl"] > .urlbar-input-container > .urlbar-input-box > & {
mask-image: linear-gradient(to right, transparent var(--urlbar-scheme-size), black calc(var(--urlbar-scheme-size) + 3ch));
}
}
#urlbar-scheme {
position: absolute;
height: 100%;
visibility: hidden;
direction: ltr;
pointer-events: none;
/* The protocol is visible if there is an RTL domain and we overflow to the left.
Uses the required-valid trick to check if it contains a value */
#urlbar:not([focused])[textoverflow="left"][domaindir="rtl"] > .urlbar-input-container > .urlbar-input-box > &:valid {
visibility: visible;
}
}
#urlbar[focused]:not([suppress-focus-border]) > #urlbar-background,
#searchbar:focus-within {
outline: var(--focus-outline);
outline-offset: var(--focus-outline-inset);
/* We used --focus-outline above to inherit its width and style properties,
but we still want to use the theme's border-color.
--toolbar-field-focus-border-color is set equal to --focus-outline-color
on :root, but LWT themes can override this value. */
outline-color: var(--toolbar-field-focus-border-color);
border-color: transparent;
}
#urlbar[focused] > #urlbar-background,
#searchbar:focus-within {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.23);
}
#urlbar[open] > #urlbar-background {
border-color: var(--arrowpanel-border-color);
box-shadow: 0 2px 14px rgba(0, 0, 0, 0.13);
}
#urlbar:is([focused], [open]),
#searchbar:focus-within {
color: var(--toolbar-field-focus-color);
}
#urlbar:is([focused], [open]) > #urlbar-background,
#searchbar:focus-within {
background-color: var(--toolbar-field-focus-background-color);
}
.urlbar-input::placeholder,
.searchbar-textbox::placeholder {
opacity: 0.69;
}
#TabsToolbar #searchbar:not(:focus-within) {
/* The tabs toolbar is usually a different color than the other toolbars, and
we can't predict it, to avoid a transparent field we enforce a border. */
border-color: color-mix(in srgb, currentColor 20%, transparent);
}
:root[lwtheme] {
.urlbar-input::selection,
.searchbar-textbox::selection {
background-color: var(--lwt-toolbar-field-highlight, Highlight);
color: var(--lwt-toolbar-field-highlight-text, HighlightText);
}
.urlbar-input:not(:focus)::selection,
.searchbar-textbox:not(:focus-within)::selection {
background-color: var(--lwt-toolbar-field-highlight, text-select-disabled-background);
}
}
#urlbar:not([focused]) {
caret-color: transparent;
}
/**
* The urlbar background is a separate element so we can animate it
* independently from the content. It's positioned absolutely and stretched to
* the bounds of the urlbar.
*/
#urlbar,
.urlbar-input-container,
.urlbarView {
position: relative;
}
#urlbar-background {
display: block;
position: absolute;
inset: 0;
}
.urlbar-input-container {
/* Match urlbar-background's border. */
border: 1px solid transparent;
padding: var(--urlbar-container-padding);
min-width: 0;
}
#urlbar-container[breakout] {
min-height: var(--urlbar-container-height);
}
#urlbar[breakout] {
display: block;
/* This is technically not needed, because popover takes care of it, but
* helps for clarity. */
position: absolute;
height: var(--urlbar-height);
width: var(--urlbar-width);
> .urlbar-input-container {
width: 100%;
height: 100%;
}
}
#urlbar:not([open]) > .urlbarView,
#urlbar:not([breakout]) > .urlbarView {
display: none;
}
#urlbar[breakout][breakout-extend] {
height: auto;
margin-left: calc(-1 * var(--urlbar-margin-inline));
width: calc(var(--urlbar-width) + 2 * var(--urlbar-margin-inline));
> .urlbar-input-container {
height: var(--urlbar-container-height);
padding-block: calc((var(--urlbar-container-height) - var(--urlbar-height)) / 2 + var(--urlbar-container-padding));
padding-inline: calc(var(--urlbar-margin-inline) + var(--urlbar-container-padding));
}
}
@keyframes urlbar-grow {
0% {
transform: scaleX(0.99) scaleY(0.98);
}
100% {
transform: scale(1);
}
}
#urlbar[breakout][breakout-extend] > #urlbar-background {
animation-name: urlbar-grow;
animation-duration: 0s;
animation-timing-function: var(--animation-easing-function);
}
@media (prefers-reduced-motion: no-preference) {
#urlbar[breakout][breakout-extend][breakout-extend-animate] > #urlbar-background {
animation-duration: 150ms;
}
}
:root[chromehidden~="toolbar"] #urlbar-container {
/* Remove excess space between the address bar and the menu button in popups. */
padding-inline-end: 0;
}
.urlbar-input-box {
/* Show the url scheme in a static box when overflowing to the left */
position: relative;
direction: ltr;
:root[customizing] & {
visibility: hidden;
}
}
#urlbar-container {
align-items: center;
/* We leave 310px plus whatever space the download and unified extensions
* buttons will need when they *both* appear. Normally, for each button, this
* should be 16px for the icon, plus 2 * 2px padding plus the
* toolbarbutton-inner-padding. We're adding 4px to ensure things like rounding
* on hidpi don't accidentally result in the buttons going into overflow.
*/
width: calc(310px + 2 * (24px + 2 * var(--toolbarbutton-inner-padding)));
/* When the download button OR the unified extensions button is shown, we leave
* 310px plus the space needed for a single button as described above. */
#nav-bar:is([downloadsbuttonshown], [unifiedextensionsbuttonshown]) & {
width: calc(310px + 24px + 2 * var(--toolbarbutton-inner-padding));
}
/* When both the download and unified extensions buttons are visible, we use
* the base min-width value. */
#nav-bar[downloadsbuttonshown][unifiedextensionsbuttonshown] & {
width: 310px;
}
/* Customize mode is difficult to use at moderate window width if the Urlbar
* remains 310px wide. */
:root[customizing] & {
width: 280px;
}
}
#urlbar-container,
#wrapper-urlbar-container {
flex: 400 0 auto;
}
#nav-bar:not([keyNav="true"]) #identity-box,
#nav-bar:not([keyNav="true"]) #tracking-protection-icon-container {
-moz-user-focus: normal;
}
#identity-icon-box {
max-width: calc(30px + 13em);
}
@media (max-width: 770px) {
#urlbar-container {
width: calc(240px + 2 * (24px + 2 * var(--toolbarbutton-inner-padding)));
}
#nav-bar:is([downloadsbuttonshown], [unifiedextensionsbuttonshown]) #urlbar-container {
width: calc(240px + 24px + 2 * var(--toolbarbutton-inner-padding));
}
#nav-bar[downloadsbuttonshown][unifiedextensionsbuttonshown] #urlbar-container {
width: 240px;
}
:root[customizing] #urlbar-container {
width: 245px;
}
#identity-icon-box {
max-width: 80px;
}
/* This label expresses the non secure status. However, as the padlock icon is
enough to tell the status to user, hide the label when window gets small.
Except this usage, #identity-icon-label is used to show additional
information that could not tell by only icons. */
#identity-box[pageproxystate="valid"].notSecureText #identity-icon-label {
display: none;
}
/* Contenxtual identity labels are user-customizable and can be very long,
so we only show the colored icon when the window gets small. */
#userContext-label {
display: none;
}
}
/* The page actions menu is hidden by default, it is only shown in small
windows as the overflow target of multiple page action buttons */
#pageActionButton {
visibility: collapse;
}
/* 680px is just below half of popular 1366px wide screens, so when putting two
browser windows next to each other on such a screen, they'll be above this
threshold. */
@media (max-width: 680px) {
/* Page action buttons are duplicated in the page action menu so we can
safely hide them in small windows. */
#pageActionSeparator,
#pageActionButton[multiple-children] ~ .urlbar-page-action {
display: none;
}
#pageActionButton[multiple-children] {
visibility: visible;
}
}
@media (max-width: 550px) {
#urlbar-container {
width: calc(176px + 2 * (24px + 2 * var(--toolbarbutton-inner-padding)));
}
#nav-bar[downloadsbuttonshown] #urlbar-container,
#nav-bar[unifiedextensionsbuttonshown] #urlbar-container {
width: calc(176px + 24px + 2 * var(--toolbarbutton-inner-padding));
}
#nav-bar[downloadsbuttonshown][unifiedextensionsbuttonshown] #urlbar-container {
width: 176px;
}
#identity-icon-box {
max-width: 70px;
}
#urlbar-zoom-button {
display: none;
}
}
/* Allow shrinking the urlbar on popup windows */
:root[chromehidden~="toolbar"] :is(#urlbar-container, #wrapper-urlbar-container) {
flex-shrink: 1;
min-width: 0;
}
#urlbar-search-splitter {
/* The splitter width should equal the location and search bars' combined
neighboring margin and border width. */
min-width: 12px;
margin: 0 -6px;
position: relative;
border: none;
background: transparent;
appearance: none;
}
/* Urlbar search mode indicator */
#urlbar-search-mode-indicator {
display: none;
background-color: var(--urlbar-box-bgcolor);
color: var(--urlbar-box-text-color);
margin-inline-end: 8px;
align-items: center;
border-radius: var(--urlbar-icon-border-radius);
padding-inline: 8px 6px;
#urlbar[focused] > .urlbar-input-container > & {
background-color: var(--urlbar-box-focus-bgcolor);
}
#urlbar[searchmode] > .urlbar-input-container > & {
display: inline-flex;
}
}
#urlbar[searchmode] > .urlbar-input-container > #urlbar-label-box {
display: none;
}
#urlbar-search-mode-indicator-close,
#searchmode-switcher-close {
background: url(chrome://global/skin/icons/close.svg) no-repeat center;
background-size: round(62.5%, 2px);
width: round(max(16px, 1em), 2px);
height: round(max(16px, 1em), 2px);
-moz-context-properties: fill, fill-opacity;
fill-opacity: 0.6;
fill: currentColor;
border-radius: var(--urlbar-icon-border-radius);
flex-shrink: 0;
@media (prefers-contrast) {
fill-opacity: 1;
}
&:hover {
background-color: var(--urlbar-box-hover-bgcolor);
color: var(--urlbar-box-hover-text-color);
&:active {
background-color: var(--urlbar-box-active-bgcolor);
color: var(--urlbar-box-hover-text-color);
}
}
}
#urlbar-search-mode-indicator-title {
padding-inline: 0 3px;
}
/* Page action panel */
.pageAction-panel-button > .toolbarbutton-icon {
list-style-image: var(--pageAction-image, inherit);
width: 16px;
height: 16px;
}
#pageAction-panel-bookmark,
#star-button {
list-style-image: url("chrome://browser/skin/bookmark-hollow.svg");
&[starred] {
list-style-image: url("chrome://browser/skin/bookmark.svg");
}
}
#star-button[starred] {
fill-opacity: 1;
fill: var(--toolbarbutton-icon-fill-attention);
}
/* URL bar and page action buttons */
/*
* The background can be very dark and if the add-on uses a black-ish svg it
* will be barely visible. For now we try to make them more visible through
* some filtering tricks.
*
* TODO(emilio): Evaluate removing this. SVGs can use prefers-color-scheme to
* determine the right color-scheme to use, see bug 1779457.
*/
.urlbar-addon-page-action[style*=".svg"] > .urlbar-icon {
:root[lwt-toolbar-field="dark"] #urlbar:not([focused]) &,
:root[lwt-toolbar-field-focus="dark"] #urlbar[focused] & {
filter: grayscale(100%) brightness(20%) invert();
}
/* As above, but for the default theme in dark mode, which suffers from the same issue */
@media (prefers-color-scheme: dark) {
:root:not([lwtheme]) & {
filter: grayscale(100%) brightness(20%) invert();
}
}
}
#userContext-icons,
#urlbar-zoom-button {
margin-inline: 6px;
}
.urlbar-icon {
width: 16px;
height: 16px;
-moz-context-properties: fill, fill-opacity;
fill: currentColor;
fill-opacity: var(--urlbar-icon-fill-opacity);
}
.urlbar-page-action,
.urlbar-revert-button,
.urlbar-go-button,
.search-go-button {
width: calc(var(--urlbar-min-height) - 2px /* border */ - 2 * var(--urlbar-container-padding));
height: calc(var(--urlbar-min-height) - 2px /* border */ - 2 * var(--urlbar-container-padding));
border-radius: var(--urlbar-icon-border-radius);
padding: var(--urlbar-icon-padding);
color: inherit;
outline: var(--toolbarbutton-outline);
outline-offset: var(--toolbarbutton-outline-offset);
&:not([disabled]):hover {
background-color: var(--urlbar-box-hover-bgcolor);
color: var(--urlbar-box-hover-text-color);
outline-color: var(--toolbarbutton-hover-outline-color);
}
&:not([disabled])[open],
&:not([disabled]):hover:active {
background-color: var(--urlbar-box-active-bgcolor);
color: var(--urlbar-box-hover-text-color);
outline-color: var(--toolbarbutton-active-outline-color);
}
}
.urlbar-page-action {
list-style-image: var(--pageAction-image, inherit);
&:focus-visible {
outline: var(--focus-outline);
outline-offset: var(--focus-outline-inset);
}
}
.urlbar-go-button,
.search-go-button {
list-style-image: url("chrome://browser/skin/forward.svg");
&:-moz-locale-dir(rtl) {
transform: scaleX(-1);
}
}
#pageActionButton,
.share-more-button {
list-style-image: url("chrome://global/skin/icons/more.svg");
}
/*
* Display visual cue that browser is under remote control.
* This is to help users visually distinguish a user agent session that
* is under remote control from those used for normal browsing sessions.
*
* Attribute is controlled by browser.js:/gRemoteControl.
*/
:root[remotecontrol] {
#remote-control-box {
visibility: visible;
padding-inline: var(--urlbar-icon-padding);
}
#remote-control-icon {
list-style-image: url(chrome://browser/content/static-robot.png);
width: 16px;
height: 16px;
}
#urlbar-background {
background-image: repeating-linear-gradient(-45deg, rgba(255, 60, 60, 0.25) 0 25px, rgba(175, 0, 0, 0.25) 25px 50px);
background-attachment: fixed;
/* Override the usual breakout animation so the gradient doesn't shift around
when the panel opens. */
animation: none !important;
}
}
/**
* Contextual Feature Recommendation
*
* Animate the recommendation icon to expand outwards and display a text label.
* Fake the effect of a smoothly expanding width without animating any widths
* by (continuously) animating only `mask-position-x` and `transform`.
*
* In a few places, transition a property using the timing-function `step-start`
* while collapsed and `step-end` while expanded in order to (discretely) modify
* the value while expanded and while transitioning in either direction.
*
* This UI is part of an experiment launching in LTR locales only. Fixing the
* RTL issues is tracked by Bug 1485725.
*/
:root {
--cfr-animation-duration: 0.35s;
--cfr-button-addons-icon: url(chrome://activity-stream/content/data/content/assets/glyph-webextension-16.svg);
--cfr-button-features-icon: url(chrome://browser/content/asrouter/assets/glyph-cfr-feature-16.svg);
--cfr-button-highlights-icon: url(chrome://global/skin/icons/highlights.svg);
--cfr-active-color: #0060df;
--cfr-active-text-color: white;
}
#contextual-feature-recommendation {
width: 28px;
margin-inline-start: 0;
transition: margin-inline-start step-end var(--cfr-animation-duration);
#urlbar[cfr-recommendation-state="expanded"] & {
margin-inline-start: calc(var(--cfr-label-width) * -1);
transition: margin-inline-start step-start var(--cfr-animation-duration);
}
&[data-cfr-icon="recommendations-icon"] {
width: auto;
#cfr-button {
list-style-image: var(--cfr-button-features-icon);
height: auto;
align-items: center;
}
}
&[data-cfr-icon="highlights-icon"] {
width: auto;
#cfr-button {
list-style-image: var(--cfr-button-highlights-icon);
height: auto;
align-items: center;
}
}
&[data-cfr-icon="webextensions-icon"] #cfr-button {
list-style-image: var(--cfr-button-addons-icon);
}
}
#cfr-button {
transition-property: fill, fill-opacity, transform;
transition-timing-function: ease-in-out;
transition-duration: var(--cfr-animation-duration);
#urlbar[cfr-recommendation-state="expanded"] & {
background-color: transparent;
transform: translateX(calc(var(--cfr-label-width) * -1));
&:-moz-locale-dir(rtl) {
transform: translateX(calc(var(--cfr-label-width)));
}
&,
.urlbar-icon {
fill: var(--cfr-active-text-color);
fill-opacity: 1;
}
}
#urlbar[cfr-recommendation-state="collapsed"] & {
animation: cfr-button-fade-through-active-color calc(3 * var(--cfr-animation-duration));
}
}
@keyframes cfr-button-fade-through-active-color {
33% {
fill-opacity: 1;
fill: var(--cfr-active-color);
}
67% {
fill-opacity: 1;
fill: var(--cfr-active-color);
}
}
#cfr-label-container {
width: 0;
overflow: hidden;
border-radius: var(--urlbar-icon-border-radius);
padding-inline-start: 28px;
mask-image: linear-gradient(to right, transparent 0, black 0);
mask-position-x: var(--cfr-label-width);
mask-repeat: no-repeat;
transition-property: background-color, mask-position-x, width, margin-inline-end;
transition-timing-function: ease-in-out, ease-in-out, step-end, step-end;
transition-duration: var(--cfr-animation-duration);
align-items: center;
margin-block: calc((var(--urlbar-min-height) - var(--urlbar-container-padding) - 2px /* border */ - 24px) / 2);
&:-moz-locale-dir(rtl) {
mask-position-x: calc(var(--cfr-label-width) * -1);
}
#urlbar[cfr-recommendation-state="expanded"] & {
width: calc(var(--cfr-label-width) + 28px);
background-color: var(--cfr-active-color);
margin-inline-end: -28px;
mask-position-x: 0;
transition-timing-function: ease-in-out, ease-in-out, step-start, step-start;
}
}
#cfr-label {
margin: 0;
padding: 3px 5px;
padding-inline-start: 0;
color: white;
mask-image: linear-gradient(to right, transparent 0, black 0);
mask-position-x: var(--cfr-label-width);
mask-repeat: no-repeat;
transition: mask-position-x ease-in-out var(--cfr-animation-duration);
&:-moz-locale-dir(rtl) {
mask-position-x: calc(var(--cfr-label-width) * -1);
}
#urlbar[cfr-recommendation-state="expanded"] & {
mask-position-x: 0;
}
}
/* Shift the url-bar text fading to stop the recommendation overlapping */
#urlbar[cfr-recommendation-state] .urlbar-input {
/* A mask-image is usually only defined for the url bar when text overflows.
We need to re-define the mask image here so that it shows up correctly when
we transition to or from an `expanded` state (in which the right end of the
url bar may be obscured without overflow). */
mask-image: linear-gradient(to left, transparent, black 3ch);
transition: mask-position-x ease-in-out var(--cfr-animation-duration);
&:-moz-locale-dir(rtl) {
mask-image: linear-gradient(to right, transparent, black 3ch);
}
}
#urlbar[cfr-recommendation-state="expanded"] .urlbar-input {
mask-position-x: calc(var(--cfr-label-width) * -1);
&:-moz-locale-dir(rtl) {
mask-position-x: calc(var(--cfr-label-width));
}
}
/* Persisted Search revert button */
.urlbar-revert-button {
list-style-image: url(chrome://global/skin/icons/defaultFavicon.svg);
fill: var(--toolbarbutton-icon-fill-attention);
&:focus-visible {
outline: var(--focus-outline);
}
}
#urlbar[persistsearchterms] {
#urlbar-revert-button-container {
display: inherit;
}
.urlbar-go-button {
display: none;
}
}
/* Reader mode icon */
#reader-mode-button > .urlbar-icon {
list-style-image: url(chrome://browser/skin/reader-mode.svg);
}
#reader-mode-button[readeractive] > .urlbar-icon {
fill: var(--toolbarbutton-icon-fill-attention);
fill-opacity: 1;
}
/* Picture-in-Picture icon */
#picture-in-picture-button > .urlbar-icon {
list-style-image: url("chrome://global/skin/media/picture-in-picture-open.svg");
}
#picture-in-picture-button[pipactive] > .urlbar-icon {
list-style-image: url("chrome://global/skin/media/picture-in-picture-closed.svg");
}
#picture-in-picture-button:-moz-locale-dir(rtl) > .urlbar-icon {
transform: scaleX(-1);
}
/* Taskbar Tabs icon */
#taskbar-tabs-button > .urlbar-icon {
list-style-image: url(chrome://browser/skin/taskbar-tabs-add-tab.svg);
:root[taskbartab] & {
list-style-image: url(chrome://browser/skin/taskbar-tabs-move-tab.svg);
}
}
/* Translations button */
#translations-button-icon {
list-style-image: url(chrome://browser/skin/translations.svg);
/* The translation icon's right letter is 1px too long, so account for that here.
Don't use margin-inline-end as this is adjusting the art of the icon. */
margin-right: -1px;
#translations-button[translationsactive] > & {
fill: var(--toolbarbutton-icon-fill-attention);
fill-opacity: 1;
}
}
#translations-button-circle-arrows {
height: 16px;
width: 16px;
list-style-image: url("chrome://global/skin/icons/loading.svg");
fill: var(--toolbarbutton-icon-fill-attention);
fill-opacity: 1;
margin-inline: 1px;
}
#translations-button-locale {
background-color: var(--toolbarbutton-icon-fill-attention);
color: var(--toolbarbutton-icon-fill-attention-text);
border-radius: 4px;
font-size: 0.8em;
height: 20px;
min-width: 20px;
text-align: center;
padding-top: 3px;
padding-inline: 1px;
box-sizing: border-box;
margin-inline: 2px -2px;
margin-block: -2px;
}
#translations-button[translationsactive="true"] {
width: auto;
}
@media (prefers-contrast) and (-moz-platform: windows) {
#translations-button-locale {
font-weight: bold;
}
#translations-button[translationsactive]:is(:hover, [open]) > #translations-button-icon {
fill: currentColor;
}
#translations-button:is(:hover, [open]) > #translations-button-locale {
background-color: var(--toolbar-field-background-color);
color: var(--toolbarbutton-icon-fill-attention);
}
#translations-button:is(:hover, [open]) > #translations-button-circle-arrows {
fill: currentColor;
}
}
/* Zoom button */
#urlbar-zoom-button {
appearance: none;
font-size: 0.8em;
padding: 3px 7px;
border-radius: var(--urlbar-icon-border-radius);
background-color: var(--urlbar-box-bgcolor);
color: var(--urlbar-box-text-color);
margin-block: calc((var(--urlbar-min-height) - 20px) / 2 - 1px /* border */ - var(--urlbar-container-padding));
overflow: hidden;
:where(#urlbar[focused]) & {
background-color: var(--urlbar-box-focus-bgcolor);
}
&:hover {
background-color: var(--urlbar-box-hover-bgcolor);
color: var(--urlbar-box-hover-text-color);
&:active {
background-color: var(--urlbar-box-active-bgcolor);
color: var(--urlbar-box-hover-text-color);
}
}
&[animate="true"] {
animation-name: urlbar-zoom-reset-pulse;
animation-duration: 250ms;
}
&:focus-visible {
outline: var(--focus-outline);
outline-offset: var(--focus-outline-inset);
}
> .toolbarbutton-text {
display: flex;
}
> .toolbarbutton-icon {
display: none;
}
}
@keyframes urlbar-zoom-reset-pulse {
0% {
transform: scale(0);
}
75% {
transform: scale(1.5);
}
100% {
transform: scale(1);
}
}
/* Search bar */
#search-container,
#wrapper-search-container:not([place="panel"]) {
flex: 175 175 auto;
}
#search-container {
min-width: 125px;
width: 125px;
&[width] {
/* Take something closer to the explicit width when requested. Also important
* to use flex-basis auto so that the width is actually honored. */
flex: 1 auto;
}
.widget-overflow-list > & {
margin: var(--arrowpanel-menuitem-margin);
width: auto;
:root[lwtheme] & > #searchbar {
/* Theme authors usually only consider contrast against the toolbar when
picking a border color for the search bar. Since the search bar can be
dragged into the overflow panel, we need to show a high-contrast border
around the searchbar in case the searchbar and panel background are the
same color. */
border-color: var(--panel-separator-color);
}
}
}
.search-go-button {
margin-inline: 1px;
}
.searchbar-search-button {
align-items: center;
fill: currentColor;
}
.searchbar-search-icon {
list-style-image: url(chrome://global/skin/icons/search-glass.svg);
-moz-context-properties: fill, fill-opacity;
fill-opacity: var(--urlbar-icon-fill-opacity);
pointer-events: none;
margin-inline: 8px 6px;
width: 16px;
}
.searchbar-search-icon-overlay {
pointer-events: none;
.searchbar-search-button[addengines="true"] > & {
list-style-image: url(chrome://browser/skin/search-indicator-badge-add.svg);
margin-inline: -15px 4px;
margin-top: -10px;
width: 11px;
height: 11px;
&:-moz-locale-dir(rtl) {
margin-inline: -25px 14px;
}
}
.searchbar-search-button:hover:not([addengines="true"]) > & {
list-style-image: url(chrome://global/skin/icons/arrow-down-12.svg);
-moz-context-properties: fill;
margin-inline: -8px 2px;
width: 6px;
height: 6px;
&:-moz-locale-dir(rtl) {
margin-inline: -26px 20px;
}
}
}
.searchbar-engine-one-off-add-engine:not([image]),
.context-menu-add-engine:not([image]) {
list-style-image: image-set(url("chrome://browser/skin/search-engine-placeholder.png"), url("chrome://browser/skin/search-engine-placeholder@2x.png") 2x);
}
.searchbar-engine-one-off-add-engine > .button-box,
.context-menu-add-engine {
position: relative;
&::before {
content: "";
position: absolute;
display: block;
background: url(chrome://browser/skin/search-indicator-badge-add.svg) no-repeat center;
height: 11px;
width: 11px;
margin-inline-start: 9px;
margin-top: -8px;
/* Needed so it paints after the icon when it is a stacking context (with
* opacity, below) */
z-index: 1;
}
}
/* Fade a little the icon so that the + badge is more evident and the button
is less likely to be visually confused with a normal search shortcut */
.searchbar-engine-one-off-add-engine[image]:not(:hover) > .button-box > .button-icon {
opacity: 0.7;
}
#urlbar-searchmode-switcher {
appearance: none;
border-radius: var(--urlbar-icon-border-radius);
margin: 0;
margin-inline-end: var(--urlbar-searchmodeswitcher-margin-inline-end);
padding-inline: var(--urlbar-searchmodeswitcher-inline-padding);
&:focus-visible {
outline: var(--focus-outline);
outline-offset: var(--focus-outline-inset);
}
&[open] {
background-color: var(--urlbar-box-focus-bgcolor);
}
/* No need space if page information icons such as lock and shield is shown */
#urlbar[pageproxystate="valid"] & {
margin-inline-end: 0;
}
#urlbar[searchmode] & {
background-color: var(--urlbar-box-bgcolor);
margin-inline-end: 0;
border-start-end-radius: 0;
border-end-end-radius: 0;
}
/* The background rule should match to #searchmode-switcher-chicklet */
#urlbar[focused] & {
background-color: var(--urlbar-box-focus-bgcolor);
}
/* stylelint-disable media-query-no-invalid */
@media (not -moz-pref("browser.urlbar.searchModeSwitcher.featureGate")) and (not -moz-pref("browser.urlbar.scotchBonnet.enableOverride")) {
display: none;
}
/* stylelint-enable media-query-no-invalid */
}
#searchmode-switcher-icon {
width: 16px;
height: 16px;
border-radius: var(--urlbar-icon-border-radius);
-moz-context-properties: fill;
fill: currentColor;
list-style-image: url("chrome://global/skin/icons/search-glass.svg");
}
#searchmode-switcher-chicklet {
background-color: var(--urlbar-box-bgcolor);
border-start-end-radius: var(--toolbarbutton-border-radius);
border-end-end-radius: var(--urlbar-icon-border-radius);
align-items: center;
height: 100%;
max-width: 40%;
margin-inline-end: var(--urlbar-searchmodeswitcher-margin-inline-end);
display: none;
/* stylelint-disable-next-line media-query-no-invalid */
@media -moz-pref("browser.urlbar.searchModeSwitcher.featureGate") or -moz-pref("browser.urlbar.scotchBonnet.enableOverride") {
#urlbar[searchmode] & {
display: inline-flex;
}
}
#urlbar[focused] & {
background-color: var(--urlbar-box-focus-bgcolor);
}
}
#searchmode-switcher-title {
margin: 0;
align-items: center;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
max-width: var(--search-engine-name-max-width);
&:empty {
display: none;
}
}
#searchmode-switcher-close {
appearance: none;
pointer-events: all;
margin-inline: var(--urlbar-searchmodeswitcher-inline-padding);
#urlbar[searchmode] & {
display: inline-flex;
}
}
#searchmode-switcher-dropmarker {
#urlbar[searchmode] & {
display: none;
}
#urlbar-searchmode-switcher[open] & {
transform: rotate(180deg);
}
}
#searchmode-switcher-popup {
--panel-padding: 4px 0;
max-width: var(--search-engine-name-max-width);
> menuitem {
margin-inline: 4px;
&.searchmode-switcher-addEngine::before {
content: "";
position: relative;
display: flex;
background: url(chrome://browser/skin/search-indicator-badge-add.svg) no-repeat center;
height: 11px;
width: 11px;
margin-inline: 10px -21px;
margin-top: -13px;
}
}
}
#searchmode-switcher-popup-description {
margin-inline: 4px;
padding: var(--arrowpanel-menuitem-padding);
}
#searchmode-switcher-popup-search-settings-button,
.searchmode-switcher-local {
-moz-context-properties: fill;
fill: currentColor;
}
/* stylelint-disable-next-line media-query-no-invalid */
@media -moz-pref("browser.urlbar.searchModeSwitcher.featureGate") or -moz-pref("browser.urlbar.scotchBonnet.enableOverride") {
#urlbar[searchmode] > .urlbar-input-container > #urlbar-search-mode-indicator {
display: none;
}
/* stylelint-disable-next-line media-query-no-invalid */
@media not -moz-pref("browser.urlbar.unifiedSearchButton.always") {
#urlbar-searchmode-switcher {
background-color: var(--urlbar-box-bgcolor);
#urlbar:not([unifiedsearchbutton-available]) > .urlbar-input-container > & {
/* Display as off-screen to get focus */
position: fixed;
top: -999px;
}
}
#searchmode-switcher-dropmarker {
margin-inline-start: var(--urlbar-searchmodeswitcher-inline-padding);
}
#urlbar[pageproxystate="invalid"] {
#identity-box,
#tracking-protection-icon-container {
display: none;
}
}
}
}
|