customizeMode.css (16320B)
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 @namespace html url("http://www.w3.org/1999/xhtml"); 6 7 /* Customization mode */ 8 9 :root { 10 --drag-drop-transition-duration: 0.3s; 11 12 @media (prefers-reduced-motion: reduce) { 13 --drag-drop-transition-duration: 0s; 14 } 15 } 16 17 :root[customizing] .customization-target:not(#widget-overflow-fixed-list) { 18 min-width: 100px; 19 } 20 21 /* When customizing, overflowable toolbars move automatically moved items back 22 * from the overflow menu, but we still don't want to render them outside of 23 * the customization target. */ 24 toolbar[overflowable][customizing] > .customization-target { 25 overflow: clip; 26 } 27 28 #customization-container { 29 flex-direction: column; 30 min-height: 0; 31 background-color: var(--toolbar-bgcolor); 32 color: var(--toolbar-color); 33 color-scheme: var(--toolbar-color-scheme); 34 35 &:not([hidden]) { 36 /* In a separate rule to avoid 'display:flex' causing the node to be 37 * displayed while the container is still hidden. */ 38 display: flex; 39 } 40 41 :root[lwtheme] & { 42 /* Ensure toolbar color displays on top of the frame/toolbox color to 43 * guarantee full opacity */ 44 background-color: var(--lwt-accent-color); 45 background-image: linear-gradient(var(--toolbar-bgcolor), var(--toolbar-bgcolor)); 46 } 47 } 48 49 #customization-content-container { 50 display: flex; 51 flex: 1; /* Grow so there isn't empty space below the footer */ 52 min-height: 0; /* Allow this to shrink so the footer doesn't get pushed out. */ 53 } 54 55 #customization-header { 56 font-weight: var(--heading-font-weight); 57 font-size: 1.2em; 58 margin: 20px 20px 15px; 59 } 60 61 #customization-panel-container { 62 --customization-panel-padding: 20px; 63 64 overflow-y: auto; 65 display: flex; 66 flex-direction: column; 67 flex: none; 68 padding: 0 var(--customization-panel-padding) 25px; 69 } 70 71 #customization-footer-spacer, 72 #customization-spacer { 73 flex: 1 1 auto; 74 } 75 76 #customization-footer { 77 display: flex; 78 align-items: center; 79 flex-shrink: 0; 80 flex-wrap: wrap; 81 border-top: 1px solid rgba(0, 0, 0, 0.15); 82 padding: 10px; 83 84 > .footer-button, 85 > .customization-checkbox, 86 > .customization-link { 87 margin-block: 0; 88 } 89 } 90 91 #customization-palette-container { 92 display: flex; 93 flex-direction: column; 94 flex: 1; 95 } 96 97 #customization-palette { 98 padding: 5px 20px 20px; 99 transition: opacity 0.3s ease-in-out; 100 opacity: 0; 101 102 &:not([hidden]) { 103 display: block; 104 flex: 1 1 auto; 105 overflow: auto; 106 min-height: 3em; 107 margin-bottom: 20px; 108 } 109 110 &[showing="true"] { 111 opacity: 1; 112 } 113 114 .toolbarbutton-1 { 115 appearance: none; 116 flex-direction: column; 117 padding: 12px 0 9px; 118 margin: 0; 119 120 :root[lwtheme-image] & { 121 fill: currentColor; 122 } 123 124 > .toolbarbutton-badge-stack > .toolbarbutton-icon { 125 width: var(--panel-and-palette-icon-size); 126 height: var(--panel-and-palette-icon-size); 127 min-width: var(--panel-and-palette-icon-size); 128 min-height: var(--panel-and-palette-icon-size); 129 padding: 0; 130 } 131 } 132 } 133 134 toolbarpaletteitem { 135 -moz-window-dragging: no-drag; 136 justify-content: flex-start; 137 138 > toolbarbutton, 139 > toolbaritem { 140 /* Prevent children from getting events. */ 141 pointer-events: none; 142 justify-content: center; 143 } 144 145 > toolbarspring { 146 outline: 1px solid; 147 opacity: 0.6; 148 149 &[removable="false"] { 150 outline: 1px dashed; 151 } 152 } 153 154 toolbarbutton[disabled] { 155 color: inherit !important; 156 } 157 158 &[removable="false"] { 159 opacity: 0.5; 160 } 161 162 &[dragover] { 163 border-inline-color: transparent; 164 } 165 166 &[place="palette"] { 167 flex-direction: column; 168 width: 7em; 169 max-width: 7em; 170 /* icon (16) + margin (9 + 12) + 3 lines of text: */ 171 height: calc(39px + 3em); 172 margin-bottom: 5px; 173 margin-inline-end: 24px; 174 overflow: visible; 175 display: inline-flex; 176 vertical-align: top; 177 178 &[hidden] { 179 display: none; 180 } 181 182 &::after { 183 content: attr(title); 184 display: block; 185 text-align: center; 186 } 187 188 /* Webextension buttons */ 189 > toolbarbutton[constrain-size="true"] > .toolbarbutton-icon, 190 > toolbarbutton[constrain-size="true"] > .toolbarbutton-badge-stack > .toolbarbutton-icon { 191 height: var(--panel-and-palette-icon-size); 192 width: var(--panel-and-palette-icon-size); 193 } 194 195 > toolbarspring { 196 outline-offset: -8px; 197 max-height: 37px; 198 } 199 200 > #search-container { 201 min-width: 7em; 202 width: 7em; 203 min-height: 37px; 204 max-height: 37px; 205 } 206 } 207 208 &[place="toolbar"] { 209 /* Override the toolkit styling for items being dragged over. */ 210 border-inline-width: 0; 211 margin-inline: 0; 212 213 > toolbarspring { 214 outline-offset: -2px; 215 margin-block: 5px; 216 } 217 } 218 219 &[place="panel"] { 220 border-block: 0 solid transparent; 221 222 > .toolbarbutton-1, 223 > toolbaritem { 224 flex: 1; 225 } 226 } 227 228 &[place="palette"], 229 &[place="panel"], 230 &[place="toolbar"] { 231 @media not (-moz-platform: macos) { 232 -moz-user-focus: normal; 233 } 234 235 &:focus-visible { 236 outline-width: 0; 237 } 238 239 &:not([mousedown]):focus-visible { 240 /* Delay adding the focusring back until after the transform transition completes. */ 241 transition: outline-width 0.01s linear var(--drag-drop-transition-duration); 242 outline: var(--default-focusring); 243 244 &[place="toolbar"] { 245 outline-offset: calc(-1 * var(--default-focusring-width) - 4px); 246 } 247 } 248 } 249 250 &:not([notransition]) { 251 &[place="palette"] { 252 transition: transform var(--drag-drop-transition-duration) ease-in-out; 253 } 254 255 &[place="panel"], 256 &[place="toolbar"] { 257 transition: border-width var(--drag-drop-transition-duration) ease-in-out; 258 } 259 } 260 261 &:not([place="palette"]) > #stop-reload-button { 262 justify-content: inherit; 263 } 264 265 #PersonalToolbar & toolbarbutton[checked], 266 toolbar & toolbarbutton[checked] > :where(.toolbarbutton-icon, .toolbarbutton-text, .toolbarbutton-badge-stack) { 267 background-color: revert !important; 268 } 269 270 > toolbarbutton > .toolbarbutton-icon, 271 > toolbarbutton > .toolbarbutton-badge-stack > .toolbarbutton-icon, 272 > #search-container, 273 > toolbaritem.toolbaritem-combined-buttons { 274 transition: transform var(--drag-drop-transition-duration) cubic-bezier(0.6, 2, 0.75, 1.5) !important; 275 } 276 277 &[mousedown] { 278 cursor: -moz-grabbing; 279 280 > toolbarbutton > .toolbarbutton-icon, 281 > toolbarbutton > .toolbarbutton-badge-stack > .toolbarbutton-icon { 282 transform: scale(1.3); 283 } 284 285 > #search-container, 286 > toolbaritem.toolbaritem-combined-buttons { 287 transform: scale(1.1); 288 } 289 290 > #search-container > #searchbar, 291 .urlbar-background { 292 outline: 1px solid color-mix(in srgb, currentColor 60%, transparent); 293 box-shadow: 0 2px 6px rgba(0, 0, 0, 0.13); 294 } 295 } 296 297 > #search-container > #searchbar > .searchbar-textbox { 298 /* Hide searchbar placeholder text in customize mode. */ 299 visibility: hidden; 300 } 301 } 302 303 #wrapper-edit-controls > #edit-controls > toolbarbutton > .toolbarbutton-icon { 304 opacity: 1; /* To ensure these buttons always look enabled in customize mode */ 305 } 306 307 #wrapper-zoom-controls[place="palette"] > #zoom-controls > #zoom-reset-button, 308 #wrapper-zoom-controls[place="palette"] > #zoom-controls > #zoom-reset-button + separator { 309 display: none; 310 } 311 312 /* Squeeze together the multi-button toolbarpaletteitems: */ 313 #wrapper-zoom-controls[place="palette"] > #zoom-controls > #zoom-out-button, 314 #wrapper-edit-controls[place="palette"] > #edit-controls > #cut-button, 315 #wrapper-profiler-button[place="palette"] > #profiler-button > #profiler-button-button { 316 align-items: flex-end; 317 } 318 #wrapper-zoom-controls[place="palette"] > #zoom-controls > #zoom-in-button, 319 #wrapper-edit-controls[place="palette"] > #edit-controls > #paste-button, 320 #wrapper-profiler-button[place="palette"] > #profiler-button > #profiler-button-dropmarker { 321 align-items: flex-start; 322 } 323 #wrapper-edit-controls[place="palette"] > #edit-controls > #copy-button { 324 flex: none; 325 } 326 327 #customization-uidensity-touch-spacer { 328 border-top: 1px solid var(--panel-separator-color); 329 margin: 6px calc(-1 * var(--arrowpanel-padding)) 9px; 330 } 331 332 #customization-uidensity-autotouchmode-checkbox { 333 margin-bottom: var(--arrowpanel-padding); 334 } 335 336 #customization-uidensity-menu { 337 font: menu; 338 339 /* Make the panel padding uniform across all platforms due to the 340 styling of the section headers and footer. */ 341 --arrowpanel-padding: 8px; 342 } 343 344 .customization-uidensity-menuitem { 345 appearance: none; 346 color: inherit; 347 border: 1px solid transparent; 348 border-radius: var(--border-radius-small); 349 padding-block: 0; 350 padding-inline: 0 5px; 351 margin: 2px 0; 352 353 > .menu-icon { 354 width: 32px; 355 height: 32px; 356 margin: 5px; 357 358 &:-moz-locale-dir(rtl) { 359 transform: scaleX(-1); 360 } 361 } 362 363 > .menu-text { 364 text-align: start; 365 } 366 367 &:hover, 368 &:focus-visible { 369 background-color: var(--button-background-color-hover); 370 } 371 372 &:hover:active, 373 &[active="true"] { 374 background-color: var(--button-background-color-active); 375 } 376 } 377 378 #customization-uidensity-menuitem-normal { 379 --menuitem-icon: url("chrome://browser/skin/customizableui/density-normal.svg"); 380 } 381 382 #customization-uidensity-menuitem-compact { 383 --menuitem-icon: url("chrome://browser/skin/customizableui/density-compact.svg"); 384 } 385 386 #customization-uidensity-menuitem-touch { 387 --menuitem-icon: url("chrome://browser/skin/customizableui/density-touch.svg"); 388 } 389 390 #customization-uidensity-button > .box-inherit > .box-inherit > .button-icon:-moz-locale-dir(rtl) { 391 transform: scaleX(-1); 392 } 393 394 #customization-panelWrapper, 395 #customization-panelWrapper > .panel-arrowcontent, 396 #customization-panelHolder { 397 flex-direction: column; 398 display: flex; 399 flex-shrink: 1; 400 min-height: calc(174px + 9em); 401 } 402 403 #customization-panelWrapper { 404 flex: 1; 405 align-items: end; /* align to the end on the cross-axis (affects arrow) */ 406 407 > .panel-arrowcontent { 408 color: var(--arrowpanel-color); 409 background: var(--arrowpanel-background); 410 background-clip: padding-box; 411 max-width: 29em; 412 413 @media (-moz-platform: macos) { 414 /* Native styling adds more 'oompf' to the popup box-shadow, so simulate that 415 * as best as we can here: */ 416 box-shadow: 417 0 0 1px hsla(0, 0%, 0%, 0.3), 418 0 4px 10px hsla(0, 0%, 0%, 0.3); 419 appearance: none; 420 border-radius: var(--arrowpanel-border-radius); 421 } 422 423 @media not (-moz-platform: macos) { 424 border: 1px solid var(--arrowpanel-border-color); 425 margin: 0; 426 box-shadow: 0 0 4px hsla(0, 0%, 0%, 0.2); 427 } 428 } 429 } 430 431 #customization-panelWrapper > .panel-arrowbox { 432 display: block; 433 position: relative; 434 height: 10px; 435 margin-bottom: -1px; 436 437 > .panel-arrow[side="top"] { 438 list-style-image: url("chrome://global/skin/arrow/panelarrow-vertical.svg"); 439 -moz-context-properties: fill, stroke; 440 fill: var(--arrowpanel-background); 441 stroke: var(--arrowpanel-border-color); 442 /* JS code sets --panel-arrow-offset to the distance between the middle of the 443 * overflow button and the end of the window. We subtract the padding of our 444 * container (#customization-panel-container) and half our own width: 445 */ 446 margin-inline-end: calc(var(--panel-arrow-offset) - var(--customization-panel-padding) - 10px); 447 vertical-align: top; 448 449 @media (-moz-platform: macos) { 450 /* The OS X image is 2px narrower than the windows/linux one. 451 * Add padding to compensate: */ 452 padding: 0 1px; 453 /* specify width for hidpi image to fit correctly */ 454 width: 20px; 455 } 456 } 457 } 458 459 #customization-panelDescription { 460 font-size: 1.1em; 461 padding: 2px 12px 10px; 462 margin: 0; 463 } 464 465 #customization-panelHeader { 466 font-size: 1.3em; 467 font-weight: var(--heading-font-weight); 468 padding: 2px 12px; 469 margin: 0; 470 } 471 472 #customization-panelHolder { 473 padding-block: 10px; 474 475 > #widget-overflow-fixed-list { 476 flex: 1; /* Grow within the available space, and allow ourselves to shrink */ 477 display: flex; 478 flex-direction: column; 479 overflow-y: auto; 480 overflow-x: hidden; 481 padding-top: 10px; 482 483 /** 484 * We create a ::before pseudoelement that contains a background image to show the 485 * drop dragon. This element fades in and out depending on whether the containing 486 * panel list is empty and unhovered, or not. 487 */ 488 &:not(:empty) { 489 padding-bottom: 50px; /* Make sure there's always space to drop stuff. */ 490 border-top: 1px solid var(--panel-separator-color); 491 } 492 493 &::before { 494 display: block; 495 content: ""; 496 background-image: image-set( 497 url("chrome://browser/skin/customizableui/empty-overflow-panel.png"), 498 url("chrome://browser/skin/customizableui/empty-overflow-panel@2x.png") 2x 499 ); 500 background-position: center bottom 10px; 501 background-size: 218px 134px; 502 background-repeat: no-repeat; 503 opacity: 0; 504 transition: opacity 300ms ease-out; 505 padding-bottom: 154px; /* 154 = 134 for the image, 10px space on either side. */ 506 margin-bottom: -154px; /* don't affect positioning of the actual contents */ 507 pointer-events: none; 508 } 509 510 &:empty::before { 511 opacity: 1; 512 } 513 &[draggingover]:empty::before { 514 opacity: 0; 515 } 516 } 517 } 518 519 #downloads-button-autohide-panel { 520 --arrowpanel-padding: 5px 12px; 521 } 522 523 #downloads-button-autohide-checkbox { 524 margin: 0; 525 padding: 0; 526 } 527 528 #whimsy-button { 529 /* Don't need HiDPI versions since the size used will be scaled down to 20x20. */ 530 list-style-image: url("chrome://browser/skin/customizableui/whimsy.png"); 531 } 532 533 #whimsy-button > .button-box > .button-icon { 534 width: 16px; 535 height: 16px; 536 } 537 538 #customization-palette[whimsypong] { 539 /* Keep the palette in the render tree but invisible 540 so -moz-element() will work. */ 541 padding: 0; 542 min-height: 0; 543 max-height: 0; 544 545 > toolbarpaletteitem > toolbarspring { 546 margin: 0 -7px; 547 } 548 549 @media (-moz-platform: linux) { 550 > toolbarpaletteitem[id^="wrapper-customizableui-special-spring"] { 551 font-size: 12px; 552 } 553 } 554 } 555 556 #wp-lives, 557 #wp-ball { 558 /* Don't need HiDPI versions since the size used will be scaled down to 20x20. */ 559 background-image: url("chrome://browser/skin/customizableui/whimsy.png"); 560 background-size: contain; 561 width: 20px; 562 } 563 564 #customization-pong-arena { 565 width: 300px; 566 height: 300px; 567 border-inline: 1px solid currentColor; 568 margin: 16px auto 0; 569 box-sizing: content-box; 570 } 571 572 #customization-palette[whimsypong] > toolbarpaletteitem[kcode], 573 #customization-pong-arena[kcode] { 574 animation-name: kcode; 575 animation-timing-function: steps(5); 576 animation-duration: 1s; 577 animation-iteration-count: infinite; 578 } 579 580 #wp-ball { 581 margin-inline-start: -10px; 582 margin-top: -10px; 583 height: 20px; 584 } 585 586 #wp-player1, 587 #wp-player2 { 588 width: 84px; 589 height: calc(39px + 3em); 590 } 591 592 #wp-player1, 593 #wp-player2, 594 #wp-ball, 595 #wp-score { 596 display: block; 597 position: fixed; 598 } 599 600 #wp-score { 601 transform: translateX(-4ch); 602 603 &:-moz-locale-dir(rtl) { 604 transform: translateX(4ch); 605 } 606 } 607 608 #wp-lives { 609 transform: translate(-4ch, 1ch); 610 611 &:-moz-locale-dir(rtl) { 612 transform: translate(4ch, 1ch); 613 } 614 615 &[lives="5"] { 616 height: 100px; 617 } 618 619 &[lives="4"] { 620 height: 80px; 621 } 622 623 &[lives="3"] { 624 height: 60px; 625 } 626 627 &[lives="2"] { 628 height: 40px; 629 } 630 631 &[lives="1"] { 632 height: 20px; 633 } 634 } 635 636 #customization-pong-arena[lives="0"] > #wp-ball { 637 animation: game-over 4s forwards ease; 638 } 639 640 @keyframes game-over { 641 0% { 642 transform: scale(1) translateY(0) rotateZ(0); 643 opacity: 1; 644 } 645 15% { 646 transform: scale(2) translateY(-10px) rotateZ(-90deg); 647 } 648 35% { 649 opacity: 1; 650 } 651 65% { 652 opacity: 0; 653 } 654 100% { 655 transform: scale(2) translateY(300px) rotateZ(-2.5turn); 656 opacity: 0; 657 } 658 } 659 660 @keyframes kcode { 661 0% { 662 border-color: rgb(195, 17, 206); 663 color: rgb(195, 17, 206); 664 } 665 20% { 666 border-color: rgb(252, 82, 27); 667 color: rgb(252, 82, 27); 668 } 669 40% { 670 border-color: rgb(251, 179, 0); 671 color: rgb(251, 179, 0); 672 } 673 60% { 674 border-color: rgb(105, 211, 0); 675 color: rgb(105, 211, 0); 676 } 677 80% { 678 border-color: rgb(20, 155, 249); 679 color: rgb(20, 155, 249); 680 } 681 100% { 682 border-color: rgb(195, 17, 206); 683 color: rgb(195, 17, 206); 684 } 685 }