Skip to content

Build your personal knowledge base with Trilium Notes

style/calendar collection: add basic support for the legacy theme

Adorian Doran0f7a48b32381
diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css
index 5db4b1582d..847cca27b9 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 0354e33462..690d49ecda 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 0208ed97cb..0c14a2d926 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 460c4f25a7..b364876ef4 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;
}