From 78de01f17eb4de3be73e3d72d5f520d479f39d35 Mon Sep 17 00:00:00 2001 From: Mara Date: Mon, 22 Sep 2025 18:12:01 +0200 Subject: [PATCH] fix: hovering and is-active should not be overwritten add the snippets to docs close #6 --- docs/snippets.md | 15 ++++++++++++++- src/template.ts | 9 --------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/docs/snippets.md b/docs/snippets.md index 7f744ee..98a8eee 100644 --- a/docs/snippets.md +++ b/docs/snippets.md @@ -31,4 +31,17 @@ To remove the border when collapsed, add just this in a separate CSS snippet: .tree-item.nav-folder[data-path="${folderName}"] { --nav-indentation-guide-color: var(${color}); } -``` \ No newline at end of file +``` + +# Adjust hovering and is active colors + +```css +.nav-file-title[class*="is-active"][data-path^="${folderName}"], +.nav-folder-title[data-path^="${folderName}"]:hover, +.nav-file-title[data-path^="${folderName}"]:hover, +.nav-folder-title[class*="is-active"][data-path^="${folderName}"] { + color: var(${color}) !important; + background-color: var(${bg}) !important; + filter: saturate(var(--spf-saturate-hover)); +} +``` diff --git a/src/template.ts b/src/template.ts index 8d2a5b8..70088fe 100644 --- a/src/template.ts +++ b/src/template.ts @@ -36,15 +36,6 @@ export function convertToCSS(folderName: string, prefix: Prefix, template: strin background-color: var(${variableNames.bg}) !important; border-radius: var(--spf-FolderRadius); } - - .nav-file-title[class*="is-active"][data-path^="${folderName}"], - .nav-folder-title[data-path^="${folderName}"]:hover, - .nav-file-title[data-path^="${folderName}"]:hover, - .nav-folder-title[class*="is-active"][data-path^="${folderName}"] { - color: var(${variableNames.color}) !important; - background-color: var(${variableNames.bg}) !important; - filter: saturate(var(--spf-saturate-hover)); - } ${dedent(remplaceTemplate(template, folderName, variableNames.bg, variableNames.color))}