Skip to content

Build your personal knowledge base with Trilium Notes

fix(dialogs): share the Next header buttons with the legacy theme

Elian Doran17691fa893c0
diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css
index b26fa4dced..2eb9dad539 100644
--- a/apps/client/src/stylesheets/style.css
+++ b/apps/client/src/stylesheets/style.css
@@ -63,6 +63,7 @@ body#trilium-app.backdrop-effects-disabled *::after {
:root {
--submenu-opening-delay: 250ms;
+ --modal-control-button-size: 22px;
--launcher-pane-size: 53px;
--bs-body-color: var(--main-text-color);
/* What a menu, the sidebar or a dialog dims the page behind it with in the phone layout. */
@@ -329,11 +330,6 @@ button.close:hover {
color: var(--hover-item-text-color);
}
-button.custom-title-bar-button {
- background: transparent;
- border: unset;
-}
-
.modal-content {
background-color: var(--modal-background-color) !important;
}
@@ -832,19 +828,6 @@ table.promoted-attributes-in-tooltip th {
float: inline-end;
}
-.help-button,
-.custom-title-bar-button {
- float: inline-end;
- background: none;
- font-weight: 900;
- border: 0;
- cursor: pointer;
-}
-
-.help-button {
- color: orange;
-}
-
/* this is because bootstrap (?) sets code color to red for some reason */
code {
color: inherit !important;
@@ -1014,10 +997,82 @@ svg.ck-icon.note-icon {
padding: 0.5rem 1rem 0.5rem 1rem !important; /* make modal header padding slightly smaller */
}
-.modal-header .help-button,
-.modal-header .custom-title-bar-button {
- padding: 6px;
- margin: 0 12px;
+/* Modal and toast control buttons (close and help) */
+
+.modal .modal-header .btn-close,
+.modal .modal-header .help-button,
+.modal .modal-header .custom-title-bar-button,
+#toast-container .toast .toast-header .btn-close,
+#toast-container .toast .toast-close .btn-close {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin-inline-start: 8px;
+ border: 0;
+ border-radius: 50%;
+ padding: 0;
+ width: var(--modal-control-button-size);
+ height: var(--modal-control-button-size);
+ background: var(--modal-control-button-background);
+ font-size: var(--modal-control-button-size);
+ line-height: normal;
+ font-weight: normal;
+ color: var(--modal-control-button-color);
+ opacity: 1;
+ cursor: default;
+}
+
+.modal .modal-header .btn-close,
+#toast-container .toast .toast-header .btn-close,
+#toast-container .toast .toast-close .btn-close {
+ --modal-control-button-hover-background: var(--modal-close-button-hover-background);
+}
+
+.modal .modal-header .btn-close::after,
+#toast-container .toast .toast-header .btn-close::after,
+#toast-container .toast .toast-close .btn-close::after {
+ content: "\ec8d";
+ font-family: boxicons;
+}
+
+.modal .modal-header .help-button,
+.modal .modal-header .custom-title-bar-button {
+ margin-inline-end: 0;
+ font-size: calc(var(--modal-control-button-size) * .70);
+ font-family: unset;
+ font-weight: bold;
+}
+
+.modal .modal-header .btn-close:hover,
+.modal .modal-header .help-button:hover,
+.modal .modal-header .custom-title-bar-button:hover,
+#toast-container .toast .toast-header .btn-close:hover,
+#toast-container .toast .toast-close .btn-close:hover {
+ background: var(--modal-control-button-hover-background);
+ color: var(--modal-control-button-hover-color);
+}
+
+.modal .modal-header .btn-close:active,
+.modal .modal-header .help-button:active,
+.modal .modal-header .custom-title-bar-button:active,
+#toast-container .toast .toast-header .btn-close:active,
+#toast-container .toast .toast-close .btn-close:active {
+ transform: scale(.85);
+}
+
+.modal .modal-header .btn-close:focus,
+.modal .modal-header .help-button:focus,
+#toast-container .toast .toast-header .btn-close:focus,
+#toast-container .toast .toast-close .btn-close:focus {
+ box-shadow: none !important;
+}
+
+.modal .modal-header .btn-close:focus-visible,
+.modal .modal-header .help-button:focus-visible,
+#toast-container .toast .toast-header .btn-close:focus-visible,
+#toast-container .toast .toast-close .btn-close:focus-visible {
+ outline: 2px solid var(--input-focus-outline-color);
+ outline-offset: 2px;
}
.modal-content-with-sidebar {
diff --git a/apps/client/src/stylesheets/theme-dark.css b/apps/client/src/stylesheets/theme-dark.css
index a9565a95e9..6a9fb8dcdd 100644
--- a/apps/client/src/stylesheets/theme-dark.css
+++ b/apps/client/src/stylesheets/theme-dark.css
@@ -105,10 +105,6 @@ body .todo-list input[type="checkbox"]:not(:checked):before {
border-color: var(--muted-text-color) !important;
}
-.btn-close {
- filter: invert(1);
-}
-
.ck-content pre {
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6) !important;
}
diff --git a/apps/client/src/stylesheets/theme-light.css b/apps/client/src/stylesheets/theme-light.css
index 48bee946c3..044d61c860 100644
--- a/apps/client/src/stylesheets/theme-light.css
+++ b/apps/client/src/stylesheets/theme-light.css
@@ -53,6 +53,12 @@ html {
--menu-item-arrow-color: #00000080;
+ --modal-control-button-background: #0000001a;
+ --modal-control-button-color: #737373;
+ --modal-control-button-hover-color: white;
+ --modal-control-button-hover-background: gray;
+ --modal-close-button-hover-background: var(--tab-close-button-hover-background);
+
--active-item-text-color: black;
--active-item-background-color: #ddd;
--active-item-border-color: transparent;
diff --git a/apps/client/src/stylesheets/theme-next-light.css b/apps/client/src/stylesheets/theme-next-light.css
index cc5e4af3ab..bab3d4e04d 100644
--- a/apps/client/src/stylesheets/theme-next-light.css
+++ b/apps/client/src/stylesheets/theme-next-light.css
@@ -121,11 +121,6 @@
--modal-border-color: #797979;
--modal-background-color: white;
--modal-title-color: gray;
- --modal-control-button-background: #0000001a;
- --modal-control-button-color: #737373;
- --modal-control-button-hover-color: white;
- --modal-control-button-hover-background: gray;
- --modal-close-button-hover-background: var(--tab-close-button-hover-background);
--modal-footer-background: #00000008;
--modal-footer-color: #00000085;
diff --git a/apps/client/src/stylesheets/theme-next/base.css b/apps/client/src/stylesheets/theme-next/base.css
index 6d64956c52..01c950b717 100644
--- a/apps/client/src/stylesheets/theme-next/base.css
+++ b/apps/client/src/stylesheets/theme-next/base.css
@@ -106,8 +106,6 @@
--opaque-icon-button-backdrop-filter: blur(32px) saturate(1000%);
- --modal-control-button-size: 22px;
-
/* Theme capabilities */
--tab-note-icons: true;
--allow-background-effects: true;
diff --git a/apps/client/src/stylesheets/theme-next/dialogs.css b/apps/client/src/stylesheets/theme-next/dialogs.css
index 23b451c738..a3674b57f7 100644
--- a/apps/client/src/stylesheets/theme-next/dialogs.css
+++ b/apps/client/src/stylesheets/theme-next/dialogs.css
@@ -9,96 +9,12 @@
background: var(--modal-background-color);
}
-/* Modal header */
-.modal .modal-header {
- border-bottom: unset;
- user-select: none;
-}
-
.modal .modal-header .modal-title {
flex-grow: 1;
font-size: 1.2em;
color: var(--modal-title-color);
}
-/* Modal and toast control buttons (close and help) */
-
-.modal .modal-header .btn-close,
-.modal .modal-header .help-button,
-.modal .modal-header .custom-title-bar-button,
-#toast-container .toast .toast-header .btn-close,
-#toast-container .toast .toast-close .btn-close {
- display: flex;
- justify-content: center;
- align-items: center;
- margin-inline-start: 8px;
- border: 0;
- border-radius: 50%;
- padding: 0;
- width: var(--modal-control-button-size);
- height: var(--modal-control-button-size);
- background: var(--modal-control-button-background);
- font-size: var(--modal-control-button-size);
- line-height: normal;
- font-weight: normal;
- color: var(--modal-control-button-color);
- opacity: 1;
- cursor: default;
-}
-
-.modal .modal-header .btn-close,
-#toast-container .toast .toast-header .btn-close,
-#toast-container .toast .toast-close .btn-close {
- --modal-control-button-hover-background: var(--modal-close-button-hover-background);
-}
-
-.modal .modal-header .btn-close::after,
-#toast-container .toast .toast-header .btn-close::after,
-#toast-container .toast .toast-close .btn-close::after {
- content: "\ec8d";
- font-family: boxicons;
-}
-
-.modal .modal-header .help-button,
-.modal .modal-header .custom-title-bar-button {
- margin-inline-end: 0;
- font-size: calc(var(--modal-control-button-size) * .70);
- font-family: unset;
- font-weight: bold;
-}
-
-.modal .modal-header .btn-close:hover,
-.modal .modal-header .help-button:hover,
-.modal .modal-header .custom-title-bar-button:hover,
-#toast-container .toast .toast-header .btn-close:hover,
-#toast-container .toast .toast-close .btn-close:hover {
- background: var(--modal-control-button-hover-background);
- color: var(--modal-control-button-hover-color);
-}
-
-.modal .modal-header .btn-close:active,
-.modal .modal-header .help-button:active,
-.modal .modal-header .custom-title-bar-button:active,
-#toast-container .toast .toast-header .btn-close:active,
-#toast-container .toast .toast-close .btn-close:active {
- transform: scale(.85);
-}
-
-.modal .modal-header .btn-close:focus,
-.modal .modal-header .help-button:focus,
-#toast-container .toast .toast-header .btn-close:focus,
-#toast-container .toast .toast-close .btn-close:focus {
- box-shadow: none !important;
-}
-
-.modal .modal-header .btn-close:focus-visible,
-.modal .modal-header .help-button:focus-visible,
-#toast-container .toast .toast-header .btn-close:focus-visible,
-#toast-container .toast .toast-close .btn-close:focus-visible {
- outline: 2px solid var(--input-focus-outline-color);
- outline-offset: 2px;
-}
-
/* Modal footer */
.modal .modal-footer {
background: var(--modal-footer-background);
diff --git a/apps/client/src/widgets/react/Modal.css b/apps/client/src/widgets/react/Modal.css
index 416341aeea..b5986c4909 100644
--- a/apps/client/src/widgets/react/Modal.css
+++ b/apps/client/src/widgets/react/Modal.css
@@ -72,3 +72,9 @@
transition: none;
}
}
+
+/* Modal header */
+.modal .modal-header {
+ --bs-modal-header-border-width: 0;
+ user-select: none;
+}