From 0f7a48b32381d9703f81674aa66be334a2f5e75e Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Mon, 1 Dec 2025 01:55:03 +0200 Subject: [PATCH] style/calendar collection: add basic support for the legacy theme --- apps/client/src/stylesheets/style.css | 11 +++++++++++ apps/client/src/stylesheets/theme-dark.css | 3 +++ apps/client/src/stylesheets/theme-light.css | 3 +++ .../src/widgets/collections/calendar/index.css | 15 ++++++++++++--- 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css index 5db4b1582..847cca27b 100644 --- a/apps/client/src/stylesheets/style.css +++ b/apps/client/src/stylesheets/style.css @@ -27,6 +27,9 @@ --bs-body-bg: var(--main-background-color) !important; --ck-mention-list-max-height: 500px; --tn-modal-max-height: 90vh; + + --tree-item-light-theme-max-color-lightness: 50; + --tree-item-dark-theme-min-color-lightness: 75; } body#trilium-app.motion-disabled *, @@ -2579,4 +2582,12 @@ iframe.print-iframe { position: relative; flex-grow: 1; width: 100%; +} + +/* Calendar collection */ + +.calendar-view a.fc-timegrid-event, +.calendar-view a.fc-daygrid-event { + /* Workaround: set font weight only if the theme-next is not active */ + font-weight: var(--root-background, 800); } \ No newline at end of file diff --git a/apps/client/src/stylesheets/theme-dark.css b/apps/client/src/stylesheets/theme-dark.css index 0354e3346..690d49ecd 100644 --- a/apps/client/src/stylesheets/theme-dark.css +++ b/apps/client/src/stylesheets/theme-dark.css @@ -76,6 +76,9 @@ --mermaid-theme: dark; --native-titlebar-background: #00000000; + + --calendar-coll-event-background-saturation: 30%; + --calendar-coll-event-background-lightness: 30%; } body ::-webkit-calendar-picker-indicator { diff --git a/apps/client/src/stylesheets/theme-light.css b/apps/client/src/stylesheets/theme-light.css index 0208ed97c..0c14a2d92 100644 --- a/apps/client/src/stylesheets/theme-light.css +++ b/apps/client/src/stylesheets/theme-light.css @@ -80,6 +80,9 @@ html { --mermaid-theme: default; --native-titlebar-background: #ffffff00; + + --calendar-coll-event-background-lightness: 95%; + --calendar-coll-event-background-saturation: 80%; } #left-pane .fancytree-node.tinted { diff --git a/apps/client/src/widgets/collections/calendar/index.css b/apps/client/src/widgets/collections/calendar/index.css index 460c4f25a..b364876ef 100644 --- a/apps/client/src/widgets/collections/calendar/index.css +++ b/apps/client/src/widgets/collections/calendar/index.css @@ -1,3 +1,12 @@ +:root { + /* Default values to be overridden by themes */ + --calendar-coll-event-background-lightness: 95%; + --calendar-coll-event-background-saturation: 80%; + --calendar-coll-event-background-color: var(--accented-background-color); + --calendar-coll-event-text-color: var(--primary-button-text-color); + --calendar-cell-event-hover-filter: none; +} + .calendar-view { --fc-event-border-color: var(--calendar-coll-event-text-color); --fc-event-bg-color: var(--calendar-coll-event-background-color); @@ -115,8 +124,8 @@ body.desktop:not(.zen) .calendar-view .calendar-header { color: currentColor; } -.fc-timegrid-event.with-hue, -.fc-daygrid-event:not(.fc-daygrid-dot-event).with-hue { +.calendar-view .fc-timegrid-event.with-hue, +.calendar-view .fc-daygrid-event:not(.fc-daygrid-dot-event).with-hue { --fc-event-text-color: var(--custom-color); background: hsl(var(--custom-color-hue), @@ -124,7 +133,7 @@ body.desktop:not(.zen) .calendar-view .calendar-header { var(--calendar-coll-event-background-lightness)) !important; } -.fc-event-time { +.calendar-view .fc-event-time { opacity: .75; }