From 8482b77eddcc05b7e3f59c2b78bc8bc88e6b2fb2 Mon Sep 17 00:00:00 2001 From: alstjr7375 Date: Sat, 28 Oct 2023 23:41:26 +0900 Subject: [PATCH] Clean: Icons - Conditional icon as variable --- css/leptonChrome.css | 122 ++++++++++------------- css/leptonChromeESR.css | 59 +++++------- css/leptonContent.css | 128 ++++++------------------- css/leptonContentESR.css | 32 +++---- src/contents/_context_menu.scss | 5 + src/icons/_index.scss | 17 ++-- src/icons/_library.scss | 5 +- src/icons/_shared.scss | 6 ++ src/icons/context_menu/_downloads.scss | 5 +- src/icons/context_menu/_place.scss | 5 +- src/icons/fork_browsers/_floorp.scss | 4 +- src/library/_folder_icons.scss | 2 +- 12 files changed, 146 insertions(+), 244 deletions(-) create mode 100644 src/icons/_shared.scss diff --git a/css/leptonChrome.css b/css/leptonChrome.css index f90eb29e..8077980d 100644 --- a/css/leptonChrome.css +++ b/css/leptonChrome.css @@ -10484,6 +10484,23 @@ } /** Icons *********************************************************************/ @supports not -moz-bool-pref("userChrome.icon.disabled") { + /** Icons - List **************************************************************/ + :root { + --uc-folder-icon: url("chrome://global/skin/icons/folder.svg"); + --uc-sidebar-icon: url("chrome://browser/skin/sidebars.svg"); + --uc-sidebar-icon-reverse: url("chrome://browser/skin/sidebars-right.svg"); + } + @supports -moz-bool-pref("userChrome.icon.library") { + :root { + --uc-folder-icon: url("../icons/folder.svg"); + } + } + @supports selector(:has(a)) { + :root:has(#sidebar-box[positionend="true"]) { + --uc-sidebar-icon: url("chrome://browser/skin/sidebars-right.svg"); + --uc-sidebar-icon-reverse: url("chrome://browser/skin/sidebars.svg"); + } + } /** Library - Icons Replace ***************************************************/ @supports -moz-bool-pref("userChrome.icon.library") { /*= Standard Folder - More Visible ===========================================*/ @@ -10495,7 +10512,7 @@ #editBMPanel_folderMenuList:not([selectedGuid="toolbar_____"], [selectedGuid="menu________"]), #editBMPanel_folderMenuList .folder-icon:not([id]), .downloadIconShow > .button-box > .button-icon { - list-style-image: url("../icons/folder.svg") !important; + list-style-image: var(--uc-folder-icon) !important; } /* Standard Folder - Open */ :-moz-any(#PlacesToolbar, #BMB_bookmarksPopup, #bookmarksMenu) @@ -10650,16 +10667,6 @@ } } /** Panel - Icons *************************************************************/ - :root { - --uc-sidebar-icon: url("chrome://browser/skin/sidebars.svg"); - --uc-sidebar-icon-reverse: url("chrome://browser/skin/sidebars-right.svg"); - } - @supports selector(:has(a)) { - :root:has(#sidebar-box[positionend="true"]) { - --uc-sidebar-icon: url("chrome://browser/skin/sidebars-right.svg"); - --uc-sidebar-icon-reverse: url("chrome://browser/skin/sidebars.svg"); - } - } @supports -moz-bool-pref("userChrome.icon.panel") { /*= Padding ==================================================================*/ :root { @@ -12315,12 +12322,7 @@ --menuitem-image: url("../icons/fluid.svg"); } .downloadShowMenuItem { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - } - @supports -moz-bool-pref("userChrome.icon.library") { - .downloadShowMenuItem { - --menuitem-image: url("../icons/folder.svg"); - } + --menuitem-image: var(--uc-folder-icon); } #downloadsContextMenu > menuitem.downloadOpenReferrerMenuItem, #downloadsContextMenu > menuitem[command="downloadsCmd_openReferrer"] { @@ -12393,13 +12395,7 @@ } #placesContext_showInFolder, #placesContext_new\:folder { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - } - @supports -moz-bool-pref("userChrome.icon.library") { - #placesContext_showInFolder, - #placesContext_new\:folder { - --menuitem-image: url("../icons/folder.svg"); - } + --menuitem-image: var(--uc-folder-icon); } #placesContext_new\:separator { --menuitem-image: url("../icons/vertical-line.svg"); @@ -12953,12 +12949,7 @@ --menuitem-image: url("chrome://browser/skin/bookmark.svg"); } #newfolder { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - } - @supports -moz-bool-pref("userChrome.icon.library") { - #newfolder { - --menuitem-image: url("../icons/folder.svg"); - } + --menuitem-image: var(--uc-folder-icon); } #newseparator { --menuitem-image: url("../icons/vertical-line.svg"); @@ -13063,7 +13054,7 @@ list-style-image: url("../icons/refresh-cw.svg"); } #openprofiledir { - list-style-image: url("../icons/folder.svg"); + list-style-image: var(--uc-folder-icon); } } @supports -moz-bool-pref("userChrome.icon.menu") { @@ -13083,7 +13074,7 @@ --menuitem-image: url("chrome://global/skin/icons/edit.svg"); } #usercssloader-submenupopup > menuitem[data-l10n-id="open-css-folder"] { - --menuitem-image: url("../icons/folder.svg"); + --menuitem-image: var(--uc-folder-icon); } #usercssloader-submenupopup > menuitem[data-l10n-id="edit-userChromeCss-editor"] { --menuitem-image: url("chrome://browser/skin/window.svg"); @@ -24647,6 +24638,12 @@ } /** Icons *********************************************************************/ @media not (-moz-bool-pref: "userChrome.icon.disabled") { + /** Icons - List **************************************************************/ + :root { + --uc-folder-icon: url("chrome://global/skin/icons/folder.svg"); + --uc-sidebar-icon: url("chrome://browser/skin/sidebars.svg"); + --uc-sidebar-icon-reverse: url("chrome://browser/skin/sidebars-right.svg"); + } /** Library - Icons Replace ***************************************************/ /** Panel - Icons *************************************************************/ /** Menu - Icons Layout *******************************************************/ @@ -24655,6 +24652,19 @@ /*= Tor Browser ==============================================================*/ /*= Floorp Browser ===========================================================*/ } +@media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.library") { + :root { + --uc-folder-icon: url("../icons/folder.svg"); + } +} +@media not (-moz-bool-pref: "userChrome.icon.disabled") { + @supports selector(:has(a)) { + :root:has(#sidebar-box[positionend="true"]) { + --uc-sidebar-icon: url("chrome://browser/skin/sidebars-right.svg"); + --uc-sidebar-icon-reverse: url("chrome://browser/skin/sidebars.svg"); + } + } +} @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.library") { /*= Standard Folder - More Visible ===========================================*/ /* on Toolbar and Menus */ @@ -24665,7 +24675,7 @@ #editBMPanel_folderMenuList:not([selectedGuid="toolbar_____"], [selectedGuid="menu________"]), #editBMPanel_folderMenuList .folder-icon:not([id]), .downloadIconShow > .button-box > .button-icon { - list-style-image: url("../icons/folder.svg") !important; + list-style-image: var(--uc-folder-icon) !important; } /* Standard Folder - Open */ :-moz-any(#PlacesToolbar, #BMB_bookmarksPopup, #bookmarksMenu) @@ -24819,18 +24829,6 @@ } } } -@media not (-moz-bool-pref: "userChrome.icon.disabled") { - :root { - --uc-sidebar-icon: url("chrome://browser/skin/sidebars.svg"); - --uc-sidebar-icon-reverse: url("chrome://browser/skin/sidebars-right.svg"); - } - @supports selector(:has(a)) { - :root:has(#sidebar-box[positionend="true"]) { - --uc-sidebar-icon: url("chrome://browser/skin/sidebars-right.svg"); - --uc-sidebar-icon-reverse: url("chrome://browser/skin/sidebars.svg"); - } - } -} @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.panel") { /*= Padding ==================================================================*/ :root { @@ -26978,12 +26976,7 @@ } @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { .downloadShowMenuItem { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - } -} -@media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") and (-moz-bool-pref: "userChrome.icon.library") { - .downloadShowMenuItem { - --menuitem-image: url("../icons/folder.svg"); + --menuitem-image: var(--uc-folder-icon); } } @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { @@ -27093,13 +27086,7 @@ @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_showInFolder, #placesContext_new\:folder { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - } -} -@media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") and (-moz-bool-pref: "userChrome.icon.library") { - #placesContext_showInFolder, - #placesContext_new\:folder { - --menuitem-image: url("../icons/folder.svg"); + --menuitem-image: var(--uc-folder-icon); } } @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { @@ -27887,25 +27874,16 @@ --menuitem-image: url("chrome://browser/skin/bookmark.svg"); } #newfolder { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); + --menuitem-image: var(--uc-folder-icon); } - /*= viewMenuPopup ============================================================*/ - /*= maintenanceButtonPopup ===================================================*/ -} -@media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.library") and (-moz-bool-pref: "userChrome.icon.library") { - #newfolder { - --menuitem-image: url("../icons/folder.svg"); - } -} -@media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.library") { #newseparator { --menuitem-image: url("../icons/vertical-line.svg"); } -} -@media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.library") { #orgUndo { --menuitem-image: url("../icons/undo.svg"); } + /*= viewMenuPopup ============================================================*/ + /*= maintenanceButtonPopup ===================================================*/ } @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.library") and (-moz-bool-pref: "userChrome.icon.menu.full") { #orgRedo { @@ -28020,7 +27998,7 @@ list-style-image: url("../icons/refresh-cw.svg"); } #openprofiledir { - list-style-image: url("../icons/folder.svg"); + list-style-image: var(--uc-folder-icon); } } @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") { @@ -28040,7 +28018,7 @@ --menuitem-image: url("chrome://global/skin/icons/edit.svg"); } #usercssloader-submenupopup > menuitem[data-l10n-id="open-css-folder"] { - --menuitem-image: url("../icons/folder.svg"); + --menuitem-image: var(--uc-folder-icon); } #usercssloader-submenupopup > menuitem[data-l10n-id="edit-userChromeCss-editor"] { --menuitem-image: url("chrome://browser/skin/window.svg"); diff --git a/css/leptonChromeESR.css b/css/leptonChromeESR.css index c341e5c4..2b1fc991 100644 --- a/css/leptonChromeESR.css +++ b/css/leptonChromeESR.css @@ -1,6 +1,6 @@ @charset "UTF-8"; -@namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; -@namespace html "http://www.w3.org/1999/xhtml"; +@namespace xul url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); +@namespace html url("http://www.w3.org/1999/xhtml"); /** Default Theme - Contrast **************************************************/ @supports -moz-bool-pref("userChrome.theme.built_in_contrast") { /*= Lightmode - Color darker =================================================*/ @@ -10901,6 +10901,23 @@ } /** Icons *********************************************************************/ @supports not -moz-bool-pref("userChrome.icon.disabled") { + /** Icons - List **************************************************************/ + :root { + --uc-folder-icon: url("chrome://global/skin/icons/folder.svg"); + --uc-sidebar-icon: url("chrome://browser/skin/sidebars.svg"); + --uc-sidebar-icon-reverse: url("chrome://browser/skin/sidebars-right.svg"); + } + @supports -moz-bool-pref("userChrome.icon.library") { + :root { + --uc-folder-icon: url("../icons/folder.svg"); + } + } + @supports selector(:has(a)) { + :root:has(#sidebar-box[positionend="true"]) { + --uc-sidebar-icon: url("chrome://browser/skin/sidebars-right.svg"); + --uc-sidebar-icon-reverse: url("chrome://browser/skin/sidebars.svg"); + } + } /** Library - Icons Replace ***************************************************/ @supports -moz-bool-pref("userChrome.icon.library") { /*= Standard Folder - More Visible ===========================================*/ @@ -10912,7 +10929,7 @@ #editBMPanel_folderMenuList:not([selectedGuid="toolbar_____"], [selectedGuid="menu________"]), #editBMPanel_folderMenuList .folder-icon:not([id]), .downloadIconShow > .button-box > .button-icon { - list-style-image: url("../icons/folder.svg") !important; + list-style-image: var(--uc-folder-icon) !important; } /* Standard Folder - Open */ :-moz-any(#PlacesToolbar, #BMB_bookmarksPopup, #bookmarksMenu) @@ -11067,16 +11084,6 @@ } } /** Panel - Icons *************************************************************/ - :root { - --uc-sidebar-icon: url("chrome://browser/skin/sidebars.svg"); - --uc-sidebar-icon-reverse: url("chrome://browser/skin/sidebars-right.svg"); - } - @supports selector(:has(a)) { - :root:has(#sidebar-box[positionend="true"]) { - --uc-sidebar-icon: url("chrome://browser/skin/sidebars-right.svg"); - --uc-sidebar-icon-reverse: url("chrome://browser/skin/sidebars.svg"); - } - } @supports -moz-bool-pref("userChrome.icon.panel") { /*= Padding ==================================================================*/ :root { @@ -12924,12 +12931,7 @@ --menuitem-image: url("../icons/fluid.svg"); } .downloadShowMenuItem { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - } - @supports -moz-bool-pref("userChrome.icon.library") { - .downloadShowMenuItem { - --menuitem-image: url("../icons/folder.svg"); - } + --menuitem-image: var(--uc-folder-icon); } #downloadsContextMenu > menuitem.downloadOpenReferrerMenuItem, #downloadsContextMenu > menuitem[command="downloadsCmd_openReferrer"] { @@ -13002,13 +13004,7 @@ } #placesContext_showInFolder, #placesContext_new\:folder { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - } - @supports -moz-bool-pref("userChrome.icon.library") { - #placesContext_showInFolder, - #placesContext_new\:folder { - --menuitem-image: url("../icons/folder.svg"); - } + --menuitem-image: var(--uc-folder-icon); } #placesContext_new\:separator { --menuitem-image: url("../icons/vertical-line.svg"); @@ -13562,12 +13558,7 @@ --menuitem-image: url("chrome://browser/skin/bookmark.svg"); } #newfolder { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - } - @supports -moz-bool-pref("userChrome.icon.library") { - #newfolder { - --menuitem-image: url("../icons/folder.svg"); - } + --menuitem-image: var(--uc-folder-icon); } #newseparator { --menuitem-image: url("../icons/vertical-line.svg"); @@ -13672,7 +13663,7 @@ list-style-image: url("../icons/refresh-cw.svg"); } #openprofiledir { - list-style-image: url("../icons/folder.svg"); + list-style-image: var(--uc-folder-icon); } } @supports -moz-bool-pref("userChrome.icon.menu") { @@ -13692,7 +13683,7 @@ --menuitem-image: url("chrome://global/skin/icons/edit.svg"); } #usercssloader-submenupopup > menuitem[data-l10n-id="open-css-folder"] { - --menuitem-image: url("../icons/folder.svg"); + --menuitem-image: var(--uc-folder-icon); } #usercssloader-submenupopup > menuitem[data-l10n-id="edit-userChromeCss-editor"] { --menuitem-image: url("chrome://browser/skin/window.svg"); diff --git a/css/leptonContent.css b/css/leptonContent.css index 584db7c6..a3cf45a2 100644 --- a/css/leptonContent.css +++ b/css/leptonContent.css @@ -2215,7 +2215,7 @@ #editBMPanel_folderMenuList:not([selectedGuid="toolbar_____"], [selectedGuid="menu________"]), #editBMPanel_folderMenuList .folder-icon:not([id]), .downloadIconShow > .button-box > .button-icon { - list-style-image: url("../icons/folder.svg") !important; + list-style-image: var(--uc-folder-icon) !important; } /* Standard Folder - Open */ :-moz-any(#PlacesToolbar, #BMB_bookmarksPopup, #bookmarksMenu) @@ -3173,6 +3173,14 @@ /** Menu - Icons Layout *******************************************************/ @supports not -moz-bool-pref("userChrome.icon.disabled") { @supports -moz-bool-pref("userChrome.icon.menu") { + :root { + --uc-folder-icon: url("chrome://global/skin/icons/folder.svg"); + } + @supports -moz-bool-pref("userChrome.icon.library") { + :root { + --uc-folder-icon: url("../icons/folder.svg"); + } + } @-moz-document url("chrome://browser/content/places/places.xhtml"), url("about:downloads") { menupopup menuitem:not([type="checkbox"][checked="true"], [type="radio"]), @@ -3367,12 +3375,7 @@ --menuitem-image: url("../icons/fluid.svg"); } .downloadShowMenuItem { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - } - @supports -moz-bool-pref("userChrome.icon.library") { - .downloadShowMenuItem { - --menuitem-image: url("../icons/folder.svg"); - } + --menuitem-image: var(--uc-folder-icon); } #downloadsContextMenu > menuitem.downloadOpenReferrerMenuItem, #downloadsContextMenu > menuitem[command="downloadsCmd_openReferrer"] { @@ -3445,13 +3448,7 @@ } #placesContext_showInFolder, #placesContext_new\:folder { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - } - @supports -moz-bool-pref("userChrome.icon.library") { - #placesContext_showInFolder, - #placesContext_new\:folder { - --menuitem-image: url("../icons/folder.svg"); - } + --menuitem-image: var(--uc-folder-icon); } #placesContext_new\:separator { --menuitem-image: url("../icons/vertical-line.svg"); @@ -3479,12 +3476,7 @@ --menuitem-image: url("chrome://browser/skin/bookmark.svg"); } #newfolder { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - } - @supports -moz-bool-pref("userChrome.icon.library") { - #newfolder { - --menuitem-image: url("../icons/folder.svg"); - } + --menuitem-image: var(--uc-folder-icon); } #newseparator { --menuitem-image: url("../icons/vertical-line.svg"); @@ -5840,7 +5832,7 @@ #editBMPanel_folderMenuList:not([selectedGuid="toolbar_____"], [selectedGuid="menu________"]), #editBMPanel_folderMenuList .folder-icon:not([id]), .downloadIconShow > .button-box > .button-icon { - list-style-image: url("../icons/folder.svg") !important; + list-style-image: var(--uc-folder-icon) !important; } /* Standard Folder - Open */ :-moz-any(#PlacesToolbar, #BMB_bookmarksPopup, #bookmarksMenu) @@ -6881,6 +6873,16 @@ } } /** Menu - Icons Layout *******************************************************/ +@media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") { + :root { + --uc-folder-icon: url("chrome://global/skin/icons/folder.svg"); + } +} +@media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.library") { + :root { + --uc-folder-icon: url("../icons/folder.svg"); + } +} @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") { @-moz-document url("chrome://browser/content/places/places.xhtml"), url("about:downloads") { @@ -7070,16 +7072,8 @@ --menuitem-image: url("../icons/fluid.svg"); } .downloadShowMenuItem { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); + --menuitem-image: var(--uc-folder-icon); } - /*= placeContext =============================================================*/ - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") and (-moz-bool-pref: "userChrome.icon.library") { - .downloadShowMenuItem { - --menuitem-image: url("../icons/folder.svg"); - } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #downloadsContextMenu > menuitem.downloadOpenReferrerMenuItem, #downloadsContextMenu > menuitem[command="downloadsCmd_openReferrer"] { --menuitem-image: url("../icons/link-square.svg"); @@ -7088,140 +7082,87 @@ #downloadsContextMenu > menuitem[command="downloadsCmd_copyLocation"] { --menuitem-image: url("../icons/link.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { .downloadDeleteFileMenuItem { --menuitem-image: url("chrome://global/skin/icons/delete.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { .downloadRemoveFromHistoryMenuItem { --menuitem-image: url("../icons/eraser.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #downloadsContextMenu > menuitem[command="downloadsCmd_clearList"], #downloadsContextMenu > menuitem[command="downloadsCmd_clearDownloads"] { --menuitem-image: url("../icons/broom.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { + /*= placeContext =============================================================*/ #placesContext_open { --menuitem-image: url("../icons/link-square.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_openBookmarkContainer\:tabs, #placesContext_openBookmarkLinks\:tabs { --menuitem-image: url("../icons/movetowindow-16.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_open\:newtab, #placesContext_openContainer\:tabs, #placesContext_openLinks\:tabs { --menuitem-image: url("chrome://browser/skin/new-tab.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_open\:newcontainertab { --menuitem-image: url("../icons/container-openin-16.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_open\:newwindow { --menuitem-image: url("chrome://browser/skin/window.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_open\:newprivatewindow { --menuitem-image: url("chrome://browser/skin/privateBrowsing.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_show_bookmark\:info, #placesContext_show\:info, #placesContext_show_folder\:info { --menuitem-image: url("chrome://global/skin/icons/edit.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_deleteBookmark, #placesContext_deleteFolder, #placesContext_delete, #placesContext_delete_history { --menuitem-image: url("chrome://global/skin/icons/delete.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_deleteHost { --menuitem-image: url("../icons/eye-hide.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_sortBy\:name { --menuitem-image: url("../icons/text-sort-ascending.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_cut { --menuitem-image: url("chrome://browser/skin/edit-cut.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_copy { --menuitem-image: url("../icons/edit-copy.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_paste_group { --menuitem-image: url("chrome://browser/skin/edit-paste.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_new\:bookmark { --menuitem-image: url("chrome://browser/skin/bookmark.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_showInFolder, #placesContext_new\:folder { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); + --menuitem-image: var(--uc-folder-icon); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") and (-moz-bool-pref: "userChrome.icon.library") { - #placesContext_showInFolder, - #placesContext_new\:folder { - --menuitem-image: url("../icons/folder.svg"); - } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_new\:separator { --menuitem-image: url("../icons/vertical-line.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_paste { --menuitem-image: url("chrome://browser/skin/edit-paste.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_createBookmark { --menuitem-image: url("chrome://browser/skin/bookmark.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #show-other-bookmarks_PersonalToolbar { /* checkbox */ --menuitem-image: url("../icons/star-line-horizontal.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { #placesContext_showAllBookmarks { --menuitem-image: url("chrome://browser/skin/bookmark-star-on-tray.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { .openintabs-menuitem { --menuitem-image: url("../icons/movetowindow-16.svg"); } @@ -7232,25 +7173,16 @@ --menuitem-image: url("chrome://browser/skin/bookmark.svg"); } #newfolder { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); + --menuitem-image: var(--uc-folder-icon); } - /*= viewMenuPopup ============================================================*/ - /*= maintenanceButtonPopup ===================================================*/ - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.global_menu") and (-moz-bool-pref: "userChrome.icon.library") { - #newfolder { - --menuitem-image: url("../icons/folder.svg"); - } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.global_menu") { #newseparator { --menuitem-image: url("../icons/vertical-line.svg"); } - } - @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.global_menu") { #orgUndo { --menuitem-image: url("../icons/undo.svg"); } + /*= viewMenuPopup ============================================================*/ + /*= maintenanceButtonPopup ===================================================*/ } @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.global_menu") and (-moz-bool-pref: "userChrome.icon.menu.full") { #orgRedo { @@ -7323,6 +7255,8 @@ } } } +} +@media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") { @-moz-document url-prefix("about:addons") { @media (not (-moz-bool-pref: "userChrome.icon.disabled")) and (-moz-bool-pref: "userChrome.icon.menu") and (-moz-bool-pref: "userChrome.icon.context_menu") { button[role="menuitem"] { diff --git a/css/leptonContentESR.css b/css/leptonContentESR.css index e5288cf1..f042280f 100644 --- a/css/leptonContentESR.css +++ b/css/leptonContentESR.css @@ -2218,7 +2218,7 @@ #editBMPanel_folderMenuList:not([selectedGuid="toolbar_____"], [selectedGuid="menu________"]), #editBMPanel_folderMenuList .folder-icon:not([id]), .downloadIconShow > .button-box > .button-icon { - list-style-image: url("../icons/folder.svg") !important; + list-style-image: var(--uc-folder-icon) !important; } /* Standard Folder - Open */ :-moz-any(#PlacesToolbar, #BMB_bookmarksPopup, #bookmarksMenu) @@ -3176,6 +3176,14 @@ /** Menu - Icons Layout *******************************************************/ @supports not -moz-bool-pref("userChrome.icon.disabled") { @supports -moz-bool-pref("userChrome.icon.menu") { + :root { + --uc-folder-icon: url("chrome://global/skin/icons/folder.svg"); + } + @supports -moz-bool-pref("userChrome.icon.library") { + :root { + --uc-folder-icon: url("../icons/folder.svg"); + } + } @-moz-document url("chrome://browser/content/places/places.xhtml"), url("about:downloads") { menupopup menuitem:not([type="checkbox"][checked="true"], [type="radio"]), @@ -3506,12 +3514,7 @@ --menuitem-image: url("../icons/fluid.svg"); } .downloadShowMenuItem { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - } - @supports -moz-bool-pref("userChrome.icon.library") { - .downloadShowMenuItem { - --menuitem-image: url("../icons/folder.svg"); - } + --menuitem-image: var(--uc-folder-icon); } #downloadsContextMenu > menuitem.downloadOpenReferrerMenuItem, #downloadsContextMenu > menuitem[command="downloadsCmd_openReferrer"] { @@ -3584,13 +3587,7 @@ } #placesContext_showInFolder, #placesContext_new\:folder { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - } - @supports -moz-bool-pref("userChrome.icon.library") { - #placesContext_showInFolder, - #placesContext_new\:folder { - --menuitem-image: url("../icons/folder.svg"); - } + --menuitem-image: var(--uc-folder-icon); } #placesContext_new\:separator { --menuitem-image: url("../icons/vertical-line.svg"); @@ -3618,12 +3615,7 @@ --menuitem-image: url("chrome://browser/skin/bookmark.svg"); } #newfolder { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - } - @supports -moz-bool-pref("userChrome.icon.library") { - #newfolder { - --menuitem-image: url("../icons/folder.svg"); - } + --menuitem-image: var(--uc-folder-icon); } #newseparator { --menuitem-image: url("../icons/vertical-line.svg"); diff --git a/src/contents/_context_menu.scss b/src/contents/_context_menu.scss index b182c50c..aa18c877 100644 --- a/src/contents/_context_menu.scss +++ b/src/contents/_context_menu.scss @@ -1,3 +1,8 @@ +@import "../icons/shared"; +:root { + @include initIcons; +} + @include moz-document( url "chrome://browser/content/places/places.xhtml", url "about:downloads" diff --git a/src/icons/_index.scss b/src/icons/_index.scss index 38c116de..e579a1ab 100644 --- a/src/icons/_index.scss +++ b/src/icons/_index.scss @@ -1,10 +1,8 @@ -/** Library - Icons Replace ***************************************************/ -@include Option("userChrome.icon.library") { - @import "../library/chrome"; -} - -/** Panel - Icons *************************************************************/ +@import "shared"; +/** Icons - List **************************************************************/ :root { + @include initIcons; + --uc-sidebar-icon: url("chrome://browser/skin/sidebars.svg"); --uc-sidebar-icon-reverse: url("chrome://browser/skin/sidebars-right.svg"); @include Has { @@ -14,6 +12,13 @@ } } } + +/** Library - Icons Replace ***************************************************/ +@include Option("userChrome.icon.library") { + @import "../library/chrome"; +} + +/** Panel - Icons *************************************************************/ @include Option("userChrome.icon.panel") { @import "layout/panel"; @import "panel"; diff --git a/src/icons/_library.scss b/src/icons/_library.scss index 7ada4333..928803a8 100644 --- a/src/icons/_library.scss +++ b/src/icons/_library.scss @@ -3,10 +3,7 @@ --menuitem-image: url("chrome://browser/skin/bookmark.svg"); } #newfolder { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - @include Option("userChrome.icon.library") { - --menuitem-image: url("../icons/folder.svg"); - } + --menuitem-image: var(--uc-folder-icon); } #newseparator { --menuitem-image: url("../icons/vertical-line.svg"); diff --git a/src/icons/_shared.scss b/src/icons/_shared.scss new file mode 100644 index 00000000..ab554336 --- /dev/null +++ b/src/icons/_shared.scss @@ -0,0 +1,6 @@ +@mixin initIcons() { + --uc-folder-icon: url("chrome://global/skin/icons/folder.svg"); + @include Option("userChrome.icon.library") { + --uc-folder-icon: url("../icons/folder.svg"); + } +} diff --git a/src/icons/context_menu/_downloads.scss b/src/icons/context_menu/_downloads.scss index 42736333..0d62f2d2 100644 --- a/src/icons/context_menu/_downloads.scss +++ b/src/icons/context_menu/_downloads.scss @@ -20,10 +20,7 @@ --menuitem-image: url("../icons/fluid.svg"); } .downloadShowMenuItem { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - @include Option("userChrome.icon.library") { - --menuitem-image: url("../icons/folder.svg"); - } + --menuitem-image: var(--uc-folder-icon); } #downloadsContextMenu > menuitem { diff --git a/src/icons/context_menu/_place.scss b/src/icons/context_menu/_place.scss index b6e6d56f..136ecaf0 100644 --- a/src/icons/context_menu/_place.scss +++ b/src/icons/context_menu/_place.scss @@ -54,10 +54,7 @@ } #placesContext_showInFolder, #placesContext_new\:folder { - --menuitem-image: url("chrome://global/skin/icons/folder.svg"); - @include Option("userChrome.icon.library") { - --menuitem-image: url("../icons/folder.svg"); - } + --menuitem-image: var(--uc-folder-icon); } #placesContext_new\:separator { --menuitem-image: url("../icons/vertical-line.svg"); diff --git a/src/icons/fork_browsers/_floorp.scss b/src/icons/fork_browsers/_floorp.scss index 140427ba..2452ffa9 100644 --- a/src/icons/fork_browsers/_floorp.scss +++ b/src/icons/fork_browsers/_floorp.scss @@ -4,7 +4,7 @@ } #openprofiledir { - list-style-image: url("../icons/folder.svg"); + list-style-image: var(--uc-folder-icon); } } @include Option("userChrome.icon.menu") { @@ -27,7 +27,7 @@ --menuitem-image: url("chrome://global/skin/icons/edit.svg"); } &[data-l10n-id="open-css-folder"] { - --menuitem-image: url("../icons/folder.svg"); + --menuitem-image: var(--uc-folder-icon); } &[data-l10n-id="edit-userChromeCss-editor"] { --menuitem-image: url("chrome://browser/skin/window.svg"); diff --git a/src/library/_folder_icons.scss b/src/library/_folder_icons.scss index 931b7e87..9d0e6e8f 100644 --- a/src/library/_folder_icons.scss +++ b/src/library/_folder_icons.scss @@ -9,7 +9,7 @@ #editBMPanel_folderMenuList .folder-icon:not([id]), /* Download Popup */ .downloadIconShow > .button-box > .button-icon { - list-style-image: url("../icons/folder.svg") !important; + list-style-image: var(--uc-folder-icon) !important; } /* Standard Folder - Open */