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(menus): draw the submenu arrow alike in every theme
Elian Doran10e65bd3bc84
diff --git a/apps/client/src/stylesheets/theme-dark.css b/apps/client/src/stylesheets/theme-dark.cssindex 6a5eb5ecbe..5b318cd95a 100644--- a/apps/client/src/stylesheets/theme-dark.css+++ b/apps/client/src/stylesheets/theme-dark.css@@ -45,6 +45,8 @@--hover-item-background-color: transparent;--hover-item-border-color: #aaa;+ --menu-item-arrow-color: #ffffffa3;+--active-item-text-color: black;--active-item-background-color: #777;--active-item-border-color: transparent;diff --git a/apps/client/src/stylesheets/theme-light.css b/apps/client/src/stylesheets/theme-light.cssindex ad4d7e6714..59fe6fda61 100644--- a/apps/client/src/stylesheets/theme-light.css+++ b/apps/client/src/stylesheets/theme-light.css@@ -49,6 +49,8 @@ html {--hover-item-background-color: transparent;--hover-item-border-color: #ccc;+ --menu-item-arrow-color: #00000080;+--active-item-text-color: black;--active-item-background-color: #ddd;--active-item-border-color: transparent;diff --git a/apps/client/src/stylesheets/theme-next/menus.css b/apps/client/src/stylesheets/theme-next/menus.cssindex 0755c6e660..5750184e61 100644--- a/apps/client/src/stylesheets/theme-next/menus.css+++ b/apps/client/src/stylesheets/theme-next/menus.css@@ -187,29 +187,6 @@ html body .dropdown-item[disabled] {border-top: 1px solid var(--menu-item-delimiter-color);}-/* Menu item arrow */-body.mobile .dropdown-submenu .dropdown-toggle::after,-body.desktop .dropdown-submenu .dropdown-toggle::after {- content: "\ed3b" !important;- position: absolute;- display: flex !important;- align-items: center;- justify-content: center;- top: 0;- inset-inline-end: 0;- margin: unset !important;- border: unset !important;- padding: 0 4px;- font-family: boxicons;- font-size: 1.2em;- color: var(--menu-item-arrow-color) !important;-}--/* Right to left, the end side is the left, so the arrow points the other way. */-body[dir=rtl] .dropdown-submenu .dropdown-toggle::after {- content: "\ea4d" !important;-}-/* Menu item group heading *//* The heading body */diff --git a/apps/client/src/widgets/react/FormList.css b/apps/client/src/widgets/react/FormList.cssindex ff7016e9ab..d73a07c4ec 100644--- a/apps/client/src/widgets/react/FormList.css+++ b/apps/client/src/widgets/react/FormList.css@@ -33,7 +33,7 @@}/* Ends the switch where a submenu row's arrow ends (see `.dropdown-submenu .dropdown-toggle::after`- in theme-next/menus.css), rather than at the padding kept for that arrow. */+ below), rather than at the padding kept for that arrow. */.dropdown-item.tn-menu-toggle {--menu-item-end-padding: 10px;}@@ -73,3 +73,32 @@}}}++/* A submenu row's arrow, pinned to the row's end. */+body.mobile .dropdown-submenu .dropdown-toggle::after,+body.desktop .dropdown-submenu .dropdown-toggle::after {+ content: "\ed3b" !important;+ position: absolute;+ display: flex !important;+ align-items: center;+ justify-content: center;+ top: 0;+ height: 100%;+ inset-inline-end: 0;+ margin: unset !important;+ border: unset !important;+ padding: 0 4px;+ font-family: boxicons;+ font-size: 1.2em;+ color: var(--menu-item-arrow-color) !important;+}++/* Right to left, the end side is the left, so the arrow points the other way. */+body[dir=rtl] .dropdown-submenu .dropdown-toggle::after {+ content: "\ea4d" !important;+}++/* The width of the arrow's box. The Next theme sets its own padding on the row and the toggle. */+.dropdown-item.dropdown-submenu {+ padding-inline-end: calc(1.2em + 8px);+}diff --git a/apps/client/src/widgets/react/Menu.css b/apps/client/src/widgets/react/Menu.cssindex 8cbdd7f6ce..984af93da6 100644--- a/apps/client/src/widgets/react/Menu.css+++ b/apps/client/src/widgets/react/Menu.css@@ -137,7 +137,7 @@ body[dir="rtl"] .dropdown-menu.tn-menu {}body.desktop .dropdown-item.dropdown-submenu.tn-menu-split {- /* The box of the arrow `.dropdown-toggle::after` draws in theme-next/base.css. */+ /* The box of the arrow `.dropdown-toggle::after` draws in FormList.css. */--tn-menu-split-toggle-width: calc(1.2em + 8px);--menu-item-end-padding: calc(var(--tn-menu-split-toggle-width) + 10px);