Skip to content

Build your personal knowledge base with Trilium Notes

feat(client): dress the note map tooltip as the app's own

Elian Doran7f1d80ca9490
diff --git a/apps/client/src/widgets/note_map/NoteMap.css b/apps/client/src/widgets/note_map/NoteMap.css
index c34617dc05..3e3d1ebf5b 100644
--- a/apps/client/src/widgets/note_map/NoteMap.css
+++ b/apps/client/src/widgets/note_map/NoteMap.css
@@ -56,6 +56,25 @@
/* End of styling the slider */
+/*
+ * The tooltip standing over the note or relation being hovered, dressed as the app's own tooltips
+ * are. The graph brings its own (float-tooltip), styled from a stylesheet it injects itself, which
+ * knows nothing of the theme — so it is dressed here in the same tokens the real ones wear, with
+ * what the themes that predate those tokens can be asked for instead.
+ */
+.note-map-container .float-tooltip-kap {
+ max-width: min(260px, 90%);
+ padding: var(--tooltip-padding, 6px 10px);
+ border-radius: var(--tooltip-border-radius, 5px);
+ background: var(--tooltip-background-color);
+ backdrop-filter: var(--tooltip-backdrop-filter);
+ box-shadow: var(--tooltip-box-shadow, 2px 2px 8px rgba(0, 0, 0, 0.2));
+ color: var(--tooltip-foreground-color, var(--main-text-color));
+ font-family: var(--main-font-family);
+ font-size: var(--tooltip-font-size, 0.9rem);
+ text-align: start;
+}
+
/*
* What the map asks the theme for what it is drawn in, each one wearing the colour it stands for so
* that it can be read back off it. The map draws on a canvas, which knows nothing of a stylesheet.