Skip to content

Build your personal knowledge base with Trilium Notes

fix(options): some download buttons appear blue

Elian Doran7b6103e9c1b6
diff --git a/apps/client/src/widgets/type_widgets/options/components/DatabaseFileList.css b/apps/client/src/widgets/type_widgets/options/components/DatabaseFileList.css
new file mode 100644
index 0000000000..6409caf133
--- /dev/null
+++ b/apps/client/src/widgets/type_widgets/options/components/DatabaseFileList.css
@@ -0,0 +1,11 @@
+/* The download action is an anchor (for the `download` attribute); without this
+ the contained icon button would inherit the link color and look different from
+ plain icon-action buttons. The :visited/:hover states must be covered explicitly,
+ as the global `a:visited`/`a:hover` color rules have a higher specificity than
+ a lone class selector (a previously downloaded file would turn blue again). */
+.database-file-download,
+.database-file-download:visited,
+.database-file-download:hover {
+ color: inherit;
+ text-decoration: none;
+}
diff --git a/apps/client/src/widgets/type_widgets/options/components/DatabaseFileList.tsx b/apps/client/src/widgets/type_widgets/options/components/DatabaseFileList.tsx
index 8dee1f3335..84b486c3ee 100644
--- a/apps/client/src/widgets/type_widgets/options/components/DatabaseFileList.tsx
+++ b/apps/client/src/widgets/type_widgets/options/components/DatabaseFileList.tsx
@@ -1,3 +1,5 @@
+import "./DatabaseFileList.css";
+
import { ComponentChildren } from "preact";
import { useMemo } from "preact/hooks";
@@ -54,7 +56,7 @@ export default function DatabaseFileList({ title, locationDescription, files, do
label={<span className="selectable-text">{fileName}</span>}
description={`${mtime ? formatDateTime(mtime) : "-"} • ${formatSize(fileSize)}`}
>
- <a href={`${downloadEndpoint}?filePath=${encodeURIComponent(filePath)}`} download>
+ <a className="database-file-download" href={`${downloadEndpoint}?filePath=${encodeURIComponent(filePath)}`} download>
<ActionButton icon="bx bx-download" text={downloadText} />
</a>
</OptionsRow>