zotero/scss/components/_menu.scss
Dan Stillman 300305a9fb fx153: Set menu icons via --menuitem-icon for in-content menus
The menu icon element is now an <html:img> that renders the 'image'
attribute or 'content: var(--menuitem-icon)', and 'list-style-image' is
ignored, so iconic menuitems showed broken-image placeholders on
Windows and Linux. list-style-image is kept for native macOS menus,
which still read it.
2026-08-04 14:42:39 -04:00

113 lines
3 KiB
SCSS

$item-type-icons: (
attachments-file: "document",
attachments-link: "attachment-link",
attachments-pdf: "attachment-pdf",
attachments-snapshot: "attachment-snapshot",
attachments-epub: "attachment-epub",
attach-note: "note",
find-file: "attachment-pdf",
convert-to-book-section: "book-section",
convert-to-book: "book",
);
@each $cls, $icon in $item-type-icons {
.zotero-menuitem-#{$cls} {
@include focus-states using ($color) {
@include svgicon-menu($icon, $color, "16", "item-type");
}
}
};
$menu-icons: (
attach: "attachment",
attachments-web-link: "link",
view-online: "globe",
show-file: "folder-open",
view-external: "page",
library-lookup: "library-lookup",
new-feed: "feed",
note: "note",
show-duplicates: "duplicate",
show-unfiled: "unfiled",
show-retracted: "retracted",
sync: "sync",
new-collection: "new-collection",
edit-collection: "rename",
edit-feed: "edit",
refresh-feed: "sync",
delete-collection: "delete-collection",
hide-collection: "hide",
remove-items: "delete-collection",
show-in-library: "library",
move-to-trash: "trash",
delete-from-lib: "empty-trash",
duplicate-item: "duplicate-item",
merge-items: "merge",
export: "export",
restore-to-library: "restore",
create-bibliography: "list-number",
create-report: "report",
retrieve-metadata: "retrieve-metadata",
unrecognize: "restore",
reindex: "reindex",
reorder-up: "up",
reorder-down: "down",
reorder-reset: "reset",
create-parent: "page",
rename-from-parent: "rename",
create-note-from-annotations: "light-dark:note-annotation",
add-to-collection: "new-collection",
new-tab: "new-tab",
new-window: "new-window",
pin: "pin",
unpin: "pin-remove",
expand-all: "expand-all",
collapse-others: "collapse-others",
change-top-level-item: "change-top-level-item",
show-publications: 'publications',
duplicate-saved-search: 'duplicate',
copy-collection: 'copy-collection',
move-collection: 'move-collection',
relate-items: 'related',
);
@each $cls, $icon in $menu-icons {
.zotero-menuitem-#{$cls} {
// If icon starts with "light-dark:", use light and dark icon
@if str-slice($icon, 0, 11) == "light-dark:" {
@include focus-states using ($color) {
@include svgicon-menu(str-slice($icon, 12), $color, "16");
}
}
@else {
@include svgicon-menu($icon, "universal", "16", false, false, (var(--fill-secondary), var(--fill-secondary)));
}
}
};
#zotero-collectionmenu, #zotero-itemmenu {
@include macOS-hide-menu-icons;
}
menupopup :is(image, .menu-icon) {
-moz-context-properties: fill, fill-opacity;
fill: var(--fill-secondary);
@media (-moz-platform: macos) {
fill: currentColor;
}
}
menuitem,
menu {
&.zotero-custom-menu-item {
@media (prefers-color-scheme: light) {
list-style-image: var(--custom-menu-icon-light, none);
--menuitem-icon: var(--custom-menu-icon-light, none);
}
@media (prefers-color-scheme: dark) {
list-style-image: var(--custom-menu-icon-dark, none);
--menuitem-icon: var(--custom-menu-icon-dark, none);
}
}
}