From 19f45090758719eaf0bf454c06a0269ed686b131 Mon Sep 17 00:00:00 2001 From: Tom Najdek Date: Fri, 22 Mar 2024 06:23:31 +0100 Subject: [PATCH] Fix incorrectly colored icons in create collection dialog (#3872) --- chrome/content/zotero/newCollectionDialog.js | 9 +++++++++ chrome/content/zotero/newCollectionDialog.xhtml | 2 +- scss/components/_menu.scss | 7 +++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/newCollectionDialog.js b/chrome/content/zotero/newCollectionDialog.js index 6d235c794a..7352ce12fa 100644 --- a/chrome/content/zotero/newCollectionDialog.js +++ b/chrome/content/zotero/newCollectionDialog.js @@ -46,9 +46,18 @@ var Zotero_New_Collection_Dialog = { _updateMenu() { let createInField = document.querySelector('#create-in'); let menupopup = createInField.firstElementChild; + let id = menupopup.id; // Fascinatingly, clearing the children of the menupopup isn't enough here. // We have to completely recreate it or it will no longer be willing to open. menupopup.replaceWith(menupopup = document.createXULElement('menupopup')); + menupopup.id = id; + + let style = document.createElement('style'); + style.innerHTML = `image { + -moz-context-properties: fill, fill-opacity; + fill: var(--fill-secondary); + }`; + createInField.shadowRoot.appendChild(style); let createdNode = Zotero.Utilities.Internal.createMenuForTarget( Zotero.Libraries.get(this._libraryID), diff --git a/chrome/content/zotero/newCollectionDialog.xhtml b/chrome/content/zotero/newCollectionDialog.xhtml index 09fc49ea17..43df4e2fe8 100644 --- a/chrome/content/zotero/newCollectionDialog.xhtml +++ b/chrome/content/zotero/newCollectionDialog.xhtml @@ -65,7 +65,7 @@ diff --git a/scss/components/_menu.scss b/scss/components/_menu.scss index 177cbab4bd..73fd4a5264 100644 --- a/scss/components/_menu.scss +++ b/scss/components/_menu.scss @@ -80,3 +80,10 @@ $menu-icons: ( #zotero-collectionmenu, #zotero-itemmenu { @include macOS-hide-menu-icons; } + +#zotero-new-collection-menu { + image { + -moz-context-properties: fill, fill-opacity; + fill: var(--fill-secondary); + } +}