|
1 | 1 | // ==UserScript== |
2 | 2 | // @name Toolbox Button |
3 | | -// @version 1.2.9 |
| 3 | +// @version 1.3.0 |
4 | 4 | // @author aminomancer |
5 | 5 | // @homepage https://github.com/aminomancer/uc.css.js |
6 | 6 | // @description Adds a new toolbar button that 1) opens the content toolbox on left click; |
|
539 | 539 | let styleSvc = Cc["@mozilla.org/content/style-sheet-service;1"].getService( |
540 | 540 | Ci.nsIStyleSheetService |
541 | 541 | ); |
542 | | - let toolboxCSS = /* css */ `.toolbarbutton-1#toolbox-button { |
| 542 | + let toolboxCSS = /* css */ ` |
| 543 | + .toolbarbutton-1#toolbox-button { |
| 544 | + --uc-toolbox-button: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="context-fill" fill-opacity="context-fill-opacity" width="16" height="16" viewBox="0 0 16 16"><path d="M16,8V6c0-1.105-.895-2-2-2H2C0.895,4,0,4.895,0,6v2h4v1.333H0v5.333c0,.368,.298,.667,.667,.667h14.667 c0.368,0,.667-.298,.667-.667V9.333h-4V8H16z M11.333,10.667H10.6c-.058,.233-.148,.457-.267,.667l0.533,.533L9.933,12.8 L9.4,12.267l-.667,.267v0.8h-1.4V12.6l-.667-.267l-.533,.533l-.933-1l0.533-.533c-.119-.209-.208-.433-.267-.667h-.8 V9.333H5.4C5.458,9.1,5.548,8.876,5.667,8.667L5.133,8.133L6.067,7.2L6.6,7.733l0.667-.267v-.8H8.6V7.4l0.667,.267L9.8,7.133 l0.933,.933L10.2,8.6c0.119,.209,.208,.433,.267,.667h0.867L11.333,10.667L11.333,10.667z"/><circle cx="8" cy="10" r="1.333"/><path d="M6,2h4v1.333h1.333v-2c0-.368-.298-.667-.667-.667H5.333c-.368,0-.667,.298-.667,.667v2H6V2z"/></svg>'); |
| 545 | + --uc-autohide-button: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="context-fill" fill-opacity="context-fill-opacity" viewBox="0 0 16 16"><path d="M5.293.293a1 1 0 011.414 0L8.414 2H13a3 3 0 013 3v8a3 3 0 01-3 3H3a3 3 0 01-3-3V5a3 3 0 013-3h.586L5.293.293zM6 2.414L4.707 3.707A1 1 0 014 4H3c-.545 0-1 .455-1 1v8c0 .545.455 1 1 1h10c.545 0 1-.455 1-1V5c0-.545-.455-1-1-1H8a1 1 0 01-.707-.293L6 2.414z"/></svg>'); |
| 546 | + list-style-image: var(--uc-toolbox-button); |
543 | 547 | -moz-box-align: center; |
544 | 548 | } |
| 549 | + .toolbarbutton-1#toolbox-button[icon="autohide"] { |
| 550 | + list-style-image: var(--uc-autohide-button); |
| 551 | + } |
545 | 552 | .toolbarbutton-1#toolbox-button .toolbarbutton-badge-stack { |
546 | 553 | -moz-box-pack: center; |
547 | 554 | } |
548 | 555 | .toolbarbutton-1#toolbox-button .toolbarbutton-icon { |
549 | 556 | height: 16px; |
550 | 557 | width: 16px; |
551 | 558 | transition: fill 50ms ease-in-out 0s; |
552 | | - } |
553 | | - .toolbarbutton-1#toolbox-button { |
554 | | - list-style-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="context-fill" fill-opacity="context-fill-opacity" width="16" height="16" viewBox="0 0 16 16"><path d="M16,8V6c0-1.105-.895-2-2-2H2C0.895,4,0,4.895,0,6v2h4v1.333H0v5.333c0,.368,.298,.667,.667,.667h14.667 c0.368,0,.667-.298,.667-.667V9.333h-4V8H16z M11.333,10.667H10.6c-.058,.233-.148,.457-.267,.667l0.533,.533L9.933,12.8 L9.4,12.267l-.667,.267v0.8h-1.4V12.6l-.667-.267l-.533,.533l-.933-1l0.533-.533c-.119-.209-.208-.433-.267-.667h-.8 V9.333H5.4C5.458,9.1,5.548,8.876,5.667,8.667L5.133,8.133L6.067,7.2L6.6,7.733l0.667-.267v-.8H8.6V7.4l0.667,.267L9.8,7.133 l0.933,.933L10.2,8.6c0.119,.209,.208,.433,.267,.667h0.867L11.333,10.667L11.333,10.667z"/><circle cx="8" cy="10" r="1.333"/><path d="M6,2h4v1.333h1.333v-2c0-.368-.298-.667-.667-.667H5.333c-.368,0-.667,.298-.667,.667v2H6V2z"/></svg>'); |
555 | | - } |
556 | | - .toolbarbutton-1#toolbox-button[icon="autohide"] { |
557 | | - list-style-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="context-fill" fill-opacity="context-fill-opacity" viewBox="0 0 16 16"><path d="M5.293.293a1 1 0 011.414 0L8.414 2H13a3 3 0 013 3v8a3 3 0 01-3 3H3a3 3 0 01-3-3V5a3 3 0 013-3h.586L5.293.293zM6 2.414L4.707 3.707A1 1 0 014 4H3c-.545 0-1 .455-1 1v8c0 .545.455 1 1 1h10c.545 0 1-.455 1-1V5c0-.545-.455-1-1-1H8a1 1 0 01-.707-.293L6 2.414z"/></svg>'); |
| 559 | + background-image: var(--uc-toolbox-button), var(--uc-autohide-button); |
| 560 | + background-size: 0, 0; |
558 | 561 | } |
559 | 562 | @media (prefers-reduced-motion: no-preference) { |
560 | 563 | .toolbarbutton-1#toolbox-button[animate] .toolbarbutton-icon { |
|
0 commit comments