From f3147bb67b633131fe70dea8913eae52f7d4756a Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Mon, 20 Apr 2026 20:25:22 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20corriger=20bug=20th=C3=A8me=20notes=20e?= =?UTF-8?q?n=20excluant=20couleur=20"default"=20des=20styles=20inline=20ba?= =?UTF-8?q?ckground-color/--note-card-fg=20pour=20permettre=20h=C3=A9ritag?= =?UTF-8?q?e=20token=20CSS=20--tile-bg=20(--header-bg=20th=C3=A8me=20actif?= =?UTF-8?q?)=20au=20lieu=20de=20override=20inline=20style,=20et=20ajouter?= =?UTF-8?q?=20removeProperty("--note-card-fg")=20dans=20branche=20else=20p?= =?UTF-8?q?our=20cleanup=20complet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shaarli-pro/js/custom_views.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/shaarli-pro/js/custom_views.js b/shaarli-pro/js/custom_views.js index a3ea2e3..9cc1a81 100644 --- a/shaarli-pro/js/custom_views.js +++ b/shaarli-pro/js/custom_views.js @@ -1823,15 +1823,21 @@ function applyNoteVisualState(element, note) { element.classList.add(`note-filter-${filter}`); } - if (colorValue) { + // For the "default" color we intentionally DO NOT set an inline + // background-color. That lets the CSS token --tile-bg (which follows + // the active theme's --header-bg) drive the tile color. A hard-coded + // inline style would win over the theme CSS (Shaarli pro theme bug). + if (colorValue && color !== "default") { element.style.backgroundColor = colorValue; element.style.removeProperty("border-color"); } else { element.style.removeProperty("background-color"); } - if (foregroundColor) { + if (foregroundColor && color !== "default") { element.style.setProperty("--note-card-fg", foregroundColor); + } else { + element.style.removeProperty("--note-card-fg"); } if (fontColor && fontColor !== "auto") {