3D viewer: model color via --model-viewer-color (Tokyo Night green); mindmap/excalidraw read theme variables

This commit is contained in:
trilium-share-gruvbox
2026-09-07 21:55:10 +02:00
parent 7c3e194116
commit 0c13f83c67
3 changed files with 17 additions and 19 deletions
+13 -17
View File
@@ -189,25 +189,21 @@
}
/* ---------- MindMap (MindElixir data) ---------- */
var MIND_DARK = [
{ bg: "#458588", bd: "#3a6b70", text: "#fbf1c7" },
{ bg: "#b8bb26", bd: "#98971a", text: "#1d2021" },
{ bg: "#d3869b", bd: "#b16286", text: "#1d2021" },
{ bg: "#8ec07c", bd: "#689d6a", text: "#1d2021" },
{ bg: "#fe8019", bd: "#d65d0e", text: "#1d2021" }
];
var MIND_LIGHT = [
{ bg: "#83a598", bd: "#458588", text: "#1d2021" },
{ bg: "#98971a", bd: "#79740e", text: "#fbf1c7" },
{ bg: "#b16286", bd: "#8f3f71", text: "#fbf1c7" },
{ bg: "#427b58", bd: "#3a6350", text: "#fbf1c7" },
{ bg: "#af3a03", bd: "#8f3003", text: "#fbf1c7" }
];
function themeVar(n, fb) {
var v = (getComputedStyle(document.documentElement).getPropertyValue(n) || "").trim();
return v || fb;
}
function mindPalette() {
return document.documentElement.classList.contains("theme-light") ? MIND_LIGHT : MIND_DARK;
return [
{ bg: themeVar("--background-active", "#458588"), bd: themeVar("--text-link", "#3a6b70"), text: themeVar("--text-menu-active", "#fbf1c7") },
{ bg: themeVar("--background-highlight", "#b8bb26"), bd: themeVar("--background-highlight", "#98971a"), text: themeVar("--text-primary", "#1d2021") },
{ bg: themeVar("--text-link", "#d3869b"), bd: themeVar("--text-link", "#b16286"), text: themeVar("--text-menu-active", "#1d2021") },
{ bg: themeVar("--background-secondary", "#8ec07c"), bd: themeVar("--background-highlight", "#689d6a"), text: themeVar("--text-primary", "#1d2021") },
{ bg: themeVar("--text-menu", "#fe8019"), bd: themeVar("--text-menu", "#d65d0e"), text: themeVar("--background-primary", "#1d2021") }
];
}
function mindEdgeColor() {
return document.documentElement.classList.contains("theme-light") ? "#928374" : "#a89984";
return themeVar("--text-menu", "#a89984");
}
function mindSize(topic, fontSize) {
var lines = String(topic || "").split("\n");
@@ -313,7 +309,7 @@
var g = svgEl("g");
if (e.angle) g.setAttribute("transform", "rotate(" + (e.angle * 180 / Math.PI) + " " + (e.x + e.width / 2) + " " + (e.y + e.height / 2) + ")");
if (typeof e.opacity === "number" && e.opacity < 100) g.setAttribute("opacity", e.opacity / 100);
var sc = e.strokeColor || "#282828", bg = e.backgroundColor || "transparent", sw = Math.max(1, e.strokeWidth || 2);
var sc = e.strokeColor || themeVar("--text-primary", "#282828"), bg = e.backgroundColor || "transparent", sw = Math.max(1, e.strokeWidth || 2);
var filled = bg && bg !== "transparent";
var fillOp = e.fillStyle === "solid" ? 1 : 0.35;
function strokeShape(shape) {