From 471659aae1ac50b63f6b99a7ca21d8423f3d5ddb Mon Sep 17 00:00:00 2001 From: MrOtherGuy Date: Sat, 3 Aug 2024 10:17:50 +0300 Subject: [PATCH] create iconized_{tabs,textbox}_context_menu.css --- chrome/iconized_tabs_context_menu.css | 87 ++++++++++++++++++++++++ chrome/iconized_textbox_context_menu.css | 63 +++++++++++++++++ html_resources/tagmap.json | 4 +- tags.csv | 2 + 4 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 chrome/iconized_tabs_context_menu.css create mode 100644 chrome/iconized_textbox_context_menu.css diff --git a/chrome/iconized_tabs_context_menu.css b/chrome/iconized_tabs_context_menu.css new file mode 100644 index 0000000..6c7f45b --- /dev/null +++ b/chrome/iconized_tabs_context_menu.css @@ -0,0 +1,87 @@ +/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/iconized_tabs_context_menu.css made available under Mozilla Public License v. 2.0 +See the above repository for updates as well as full license text. */ + +/* Adds icons to menuitems in tabs context menu. + * Note that this won't work if you have native context menus, + * such as ones used on MacOS */ + +:where(#tabContextMenu > menu:not(.menu-iconic))::before, +:where(#tabContextMenu > menuitem:not(.menuitem-iconic))::before{ + display: flex; + padding-inline-end: 8px; + padding-top: 2px; + width: 16px; + height: 16px; + align-items: center; + justify-content: center; + content: url("chrome://browser/skin/tab.svg"); + -moz-context-properties: fill; + fill: currentColor; +} +:where(#tabContextMenu > menu), +:where(#tabContextMenu > menuitem){ + padding-inline-start: 1em !important; +} +#tabContextMenu > menuitem[type="checkbox"]::before{ + content: url("chrome://devtools/skin/images/checkbox.svg"); +} +#tabContextMenu > menuitem[type="checkbox"] > .menu-iconic-left{ + display: none; +} +#tabContextMenu > menuitem[type="checkbox"][_moz-menuactive]::before, +#tabContextMenu > menuitem[type="checkbox"][checked="true"]::before{ + background: no-repeat center left url("chrome://global/skin/icons/check.svg"); +} +#context_openANewTab::before{ + content: url("chrome://browser/skin/new-tab.svg"); +} +#context_reloadTab::before, +#context_reloadSelectedTabs::before{ + content: url("chrome://global/skin/icons/reload.svg"); +} +#context_playTab::before, +#context_playSelectedTabs::before{ + content: url("chrome://devtools/skin/images/play.svg"); +} +#context_toggleMuteTab::before, +#context_toggleMuteSelectedTabs::before{ + content: url("chrome://global/skin/media/audio-muted.svg"); + transform: scale(0.85); +} +#context_toggleMuteTab[muted="true"]::before, +#context_toggleMuteSelectedTabs[muted="true"]::before{ + content: url("chrome://global/skin/media/audio.svg"); + transform: scale(0.85); +} +#context_unpinTab::before, +#context_unpinSelectedTabs::before, +#context_pinTab::before, +#context_pinSelectedTabs::before{ + content: url("chrome://browser/skin/pin-12.svg"); + transform: scale(1.15); +} +#context_duplicateTab::before, +#context_duplicateTabs::before{ + content: url("chrome://devtools/skin/images/command-always-on-top-window.svg"); +} +#context_bookmarkTab::before, +#context_bookmarkSelectedTabs::before{ + content: url("chrome://browser/skin/bookmark-hollow.svg"); +} +#context_sendTabToDevice::before{ + content: url("chrome://browser/skin/synced-tabs.svg"); +} +#context_selectAllTabs::before{ + content: url("chrome://devtools/skin/images/tool-application.svg"); +} +#context_closeTab::before, +#context_closeDuplicateTabs::before, +#context_closeTabOptions::before{ + content: url("chrome://global/skin/icons/close.svg"); +} +#context_undoCloseTab::before{ + content: url("chrome://browser/skin/forget.svg"); +} +#tabContextMenu > .share-tab-url-item::before{ + content: url("chrome://devtools/skin/images/diff.svg"); +} \ No newline at end of file diff --git a/chrome/iconized_textbox_context_menu.css b/chrome/iconized_textbox_context_menu.css new file mode 100644 index 0000000..71e32bb --- /dev/null +++ b/chrome/iconized_textbox_context_menu.css @@ -0,0 +1,63 @@ +/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/iconized_textbox_context_menu.css made available under Mozilla Public License v. 2.0 +See the above repository for updates as well as full license text. */ + +/* Adds icons to menuitems in textbox context menus, such as urlbar and searchbar. + * Note that this won't work if you have native context menus, + * such as ones used on MacOS */ + +:where(.textbox-contextmenu > menu:not(.menu-iconic))::before, +:where(.textbox-contextmenu > menuitem:not(.menuitem-iconic))::before{ + display: flex; + padding-inline-end: 8px; + padding-top: 2px; + width: 16px; + height: 16px; + align-items: center; + justify-content: center; + content: url("chrome://browser/skin/tab.svg"); + -moz-context-properties: fill; + fill: currentColor; +} +:where(.textbox-contextmenu > menu), +:where(.textbox-contextmenu > menuitem){ + padding-inline-start: 1em !important; +} +.textbox-contextmenu > menuitem[type="checkbox"]::before{ + content: url("chrome://devtools/skin/images/checkbox.svg"); +} +.textbox-contextmenu > menuitem[type="checkbox"] > .menu-iconic-left{ + display: none; +} +.textbox-contextmenu > [data-l10n-id="text-action-undo"]::before, +.textbox-contextmenu > [data-l10n-id="text-action-redo"]::before{ + content: url("chrome://global/skin/icons/undo.svg"); +} +.textbox-contextmenu > [data-l10n-id="text-action-redo"]::before{ + transform-box: content-box; + transform: scaleX(-1); +} +.textbox-contextmenu > [data-l10n-id="text-action-copy"]::before{ + content: url("chrome://global/skin/icons/edit-copy.svg"); +} +.textbox-contextmenu > [data-l10n-id="text-action-strip-on-share"]::before{ + content: url("chrome://devtools/skin/images/command-always-on-top-window.svg"); +} +.textbox-contextmenu > [data-l10n-id="text-action-cut"]::before{ + content: url("chrome://browser/skin/edit-cut.svg"); +} +.textbox-contextmenu > [data-l10n-id="text-action-paste"]::before{ + content: url("chrome://browser/skin/edit-paste.svg"); +} +.textbox-contextmenu > #paste-and-go::before{ + content: url("chrome://browser/skin/edit-paste.svg"); +} +.textbox-contextmenu > .searchbar-paste-and-search::before{ + content: url("chrome://global/skin/icons/search-glass.svg"); +} +.textbox-contextmenu > [data-l10n-id="text-action-delete"]::before{ + content: url("chrome://global/skin/icons/delete.svg"); +} +.textbox-contextmenu > [data-l10n-id="text-action-select-all"]::before{ + content: url("chrome://global/skin/reader/character-spacing-20.svg"); + transform: scale(0.85); +} \ No newline at end of file diff --git a/html_resources/tagmap.json b/html_resources/tagmap.json index f3e4b16..de29a92 100644 --- a/html_resources/tagmap.json +++ b/html_resources/tagmap.json @@ -173,5 +173,7 @@ "window_control_fallback_for_custom_windows_theme.css":["window-control","buttons","colors","patch"], "window_control_force_linux_system_style.css":["window-control","buttons","icon"], "window_control_placeholder_support.css":["window-control","patch"], -"iconized_places_context_menu.css":["menu","icon"] +"iconized_places_context_menu.css":["menu","icon"], +"iconized_tabs_context_menu.css":["menu","icon"], +"iconized_textbox_context_menu.css":["menu","icon"] } diff --git a/tags.csv b/tags.csv index d0673aa..84ae082 100644 --- a/tags.csv +++ b/tags.csv @@ -173,3 +173,5 @@ window_control_fallback_for_custom_windows_theme.css,window-control,buttons,colo window_control_force_linux_system_style.css,window-control,buttons,icon window_control_placeholder_support.css,window-control,patch iconized_places_context_menu.css,menu,icon +iconized_tabs_context_menu.css,menu,icon +iconized_textbox_context_menu.css,menu,icon