Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(theme-next): opaque fallback for list-style menus under background effects
Elian Doranc932a470d166
diff --git a/apps/client/src/stylesheets/theme-next/base.css b/apps/client/src/stylesheets/theme-next/base.cssindex 0178c76df7..7e6beaed4f 100644--- a/apps/client/src/stylesheets/theme-next/base.css+++ b/apps/client/src/stylesheets/theme-next/base.css@@ -202,6 +202,23 @@ body.desktop .dropdown-submenu .dropdown-menu {background: transparent;}+/*+ * With background effects on, the Electron window is transparent, and that breaks the+ * list-style menus specifically: they carry `backdrop-filter` on the menu element itself+ * (a scrollable menu can't use the `::before` layer — the pseudo scrolls away with the+ * content), and an element that both filters and paints a translucent background gets+ * flattened into one render surface, which composites wrongly over window-transparent+ * regions — the background is lost with the filter and the menu renders see-through.+ * Regular menus survive because their filter is isolated on the background-less pseudo.+ * The blur also has nothing to sample there anyway: CSS can only blur web-painted pixels,+ * never the OS-composited material behind the window. So list menus fall back to the+ * opaque menu color, the same one used when backdrop effects are disabled.+ */+body.background-effects .dropdown-menu.tn-dropdown-list {+ --menu-background-color: var(--menu-background-color-no-backdrop);+ backdrop-filter: none;+}+.dropdown-item,.excalidraw .context-menu .context-menu-item {--menu-item-start-padding: 8px;diff --git a/apps/client/src/stylesheets/theme-next/shell.css b/apps/client/src/stylesheets/theme-next/shell.cssindex 39d1cdb17c..1b388d7cfb 100644--- a/apps/client/src/stylesheets/theme-next/shell.css+++ b/apps/client/src/stylesheets/theme-next/shell.css@@ -638,16 +638,6 @@ div.quick-search .dropdown-menu {--menu-item-icon-vert-offset: -.065em;}-/*- * TO FIX: The quick search results dropdown has a backdrop issue with the tree panel- * when background effects are enabled in Electron.- * As a temporary workaround, the backdrop and transparency are disabled for the- * vertical layout.- */-body.layout-vertical.background-effects div.quick-search .dropdown-menu {- --menu-background-color: var(--menu-background-color-no-backdrop) !important;-}-/* Item */.quick-search .dropdown-menu *.dropdown-item {padding: 8px 12px !important;