feat: corriger bug thème notes en excluant couleur "default" des styles inline background-color/--note-card-fg pour permettre héritage token CSS --tile-bg (--header-bg thème actif) au lieu de override inline style, et ajouter removeProperty("--note-card-fg") dans branche else pour cleanup complet

This commit is contained in:
Bruno Charest 2026-04-20 20:25:22 -04:00
parent bccfa42524
commit f3147bb67b

View File

@ -1823,15 +1823,21 @@ function applyNoteVisualState(element, note) {
element.classList.add(`note-filter-${filter}`); 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.backgroundColor = colorValue;
element.style.removeProperty("border-color"); element.style.removeProperty("border-color");
} else { } else {
element.style.removeProperty("background-color"); element.style.removeProperty("background-color");
} }
if (foregroundColor) { if (foregroundColor && color !== "default") {
element.style.setProperty("--note-card-fg", foregroundColor); element.style.setProperty("--note-card-fg", foregroundColor);
} else {
element.style.removeProperty("--note-card-fg");
} }
if (fontColor && fontColor !== "auto") { if (fontColor && fontColor !== "auto") {