Skip to content

Build your personal knowledge base with Trilium Notes

style/backend log: expose the CSS variable for timestamps

Adorian Doran035f074d5bf6
diff --git a/apps/client/src/stylesheets/theme-next-dark.css b/apps/client/src/stylesheets/theme-next-dark.css
index f1d59a0eb9..f413c4d49d 100644
--- a/apps/client/src/stylesheets/theme-next-dark.css
+++ b/apps/client/src/stylesheets/theme-next-dark.css
@@ -270,6 +270,7 @@
--code-block-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
/* Backend log (the `text/x-trilium-log` code note MIME) */
+ --log-timestamp-color: #818181;
--log-http-line-background-color: rgba(255, 255, 255, 0.02);
--log-http-verb-color: #d99bf4;
--log-http-url-color: #d0b6e4;
diff --git a/apps/client/src/stylesheets/theme-next-light.css b/apps/client/src/stylesheets/theme-next-light.css
index ff0a688c1c..b065f35237 100644
--- a/apps/client/src/stylesheets/theme-next-light.css
+++ b/apps/client/src/stylesheets/theme-next-light.css
@@ -268,6 +268,7 @@
--code-block-box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.1), 0px 0px 2px rgba(0, 0, 0, 0.2);
/* Backend log (the `text/x-trilium-log` code note MIME) */
+ --log-timestamp-color: var(--muted-text-color);
--log-http-line-background-color: rgba(0, 0, 0, 0.03);
--log-http-verb-color: #0969da;
--log-http-url-color: #1b6b6b;
diff --git a/packages/codemirror/src/extensions/trilium_log_highlighter.ts b/packages/codemirror/src/extensions/trilium_log_highlighter.ts
index 58aba4fa06..c6f25a3a0b 100644
--- a/packages/codemirror/src/extensions/trilium_log_highlighter.ts
+++ b/packages/codemirror/src/extensions/trilium_log_highlighter.ts
@@ -52,7 +52,7 @@ const statusMarks: Record<string, Decoration> = {
* fallbacks below are what the legacy themes — which don't define those variables — render with.
*/
const logHighlightTheme = EditorView.baseTheme({
- ".cm-log-timestamp": { color: "var(--muted-text-color)" },
+ ".cm-log-timestamp": { color: "var(--log-timestamp-color, var(--muted-text-color))" },
".cm-log-http": { backgroundColor: "var(--log-http-line-background-color, color-mix(in srgb, var(--main-text-color) 3%, transparent))" },
".cm-log-verb": { fontWeight: "bold", color: "var(--log-http-verb-color, #539bf5)" },
".cm-log-url": { color: "var(--log-http-url-color, #268a8a)" },