Skip to content

Build your personal knowledge base with Trilium Notes

style/custom task states: add the initial support for light / dark color schemes

Adorian Doranfcd7096ed835
diff --git a/apps/client/src/stylesheets/style.css b/apps/client/src/stylesheets/style.css
index d6afa0a38b..4a4d5d750d 100644
--- a/apps/client/src/stylesheets/style.css
+++ b/apps/client/src/stylesheets/style.css
@@ -2751,11 +2751,13 @@ iframe.print-iframe {
* TASK STATES
*/
-:root {
+:where(:root) {
--task-checkbox-without-state-background: #d5d5d5;
- --task-checkbox-with-state-background: gray;
+ --task-checkbox-with-state-background: orange;
--task-checkbox-done-color: green;
- --task-checkbox-color: white;
+ --task-checkbox-unknown-state-color: orange;
+ --task-checkbox-glyph-color: white;
+
--task-checkbox-border-radius: 4px;
--task-checkbox-glyph-ratio: .8;
}
@@ -2773,6 +2775,7 @@ iframe.print-iframe {
--task-state-glyph: initial;
--task-state-glyph-font-family: initial;
--task-state-color: initial;
+ --task-state-adjusted-color: initial;
--task-state-hue: initial;
--_task-checkbox-background: initial;
}
@@ -2780,7 +2783,7 @@ iframe.print-iframe {
/* All tasks with a state */
:where(.ck-content .todo-list li[data-trilium-task-state]:not([data-trilium-task-state="none"])),
.tn-task-checkbox:not([data-trilium-task-state="none"]) {
- --_task-checkbox-background: var(--task-state-color, var(--task-checkbox-with-state-background));
+ --_task-checkbox-background: var(--task-state-adjusted-color, var(--task-state-color, var(--task-checkbox-with-state-background)));
}
/* Default checked state */
@@ -2821,7 +2824,7 @@ iframe.print-iframe {
content: var(--task-state-glyph);
font-family: var(--task-state-glyph-font-family, inherit);
font-size: calc(var(--_checkbox-size) * var(--task-checkbox-glyph-ratio));
- color: var(--task-checkbox-color);
+ color: var(--task-checkbox-glyph-color);
text-box-trim: trim-both;
}
@@ -2833,5 +2836,5 @@ iframe.print-iframe {
/* Unknown state: orange outline */
.tn-unknown-task-state .todo-list__label input[type="checkbox"] {
- outline: 3px solid orange;
+ outline: 3px solid var(--task-checkbox-unknown-state-color);
}
\ No newline at end of file
diff --git a/apps/client/src/stylesheets/theme-next-dark.css b/apps/client/src/stylesheets/theme-next-dark.css
index b63ebc1d6a..f92d4db844 100644
--- a/apps/client/src/stylesheets/theme-next-dark.css
+++ b/apps/client/src/stylesheets/theme-next-dark.css
@@ -320,6 +320,12 @@
--calendar-coll-event-hover-filter: brightness(1.25);
--callendar-coll-event-archived-sripe-color: #00000026;
--calendar-coll-today-background-color: #ffffff08;
+
+ --task-checkbox-without-state-background: #ffffff26;
+ --task-checkbox-with-state-background: #ffffff3b;
+ --task-checkbox-done-color: #408b40;
+ --task-checkbox-unknown-state-color: orange;
+ --task-checkbox-glyph-color: white;
}
/*
@@ -398,4 +404,8 @@ body .todo-list input[type="checkbox"]:not(:checked):before {
.note-tooltip.with-hue {
--tooltip-background-color: hsl(var(--custom-color-hue), 8.8%, 24%);
+}
+
+[data-trilium-task-state] {
+ --task-state-adjusted-color: hsl(var(--task-state-hue), 40%, 50%);
}
\ No newline at end of file
diff --git a/apps/client/src/stylesheets/theme-next-light.css b/apps/client/src/stylesheets/theme-next-light.css
index 5133553546..8df14e6f5d 100644
--- a/apps/client/src/stylesheets/theme-next-light.css
+++ b/apps/client/src/stylesheets/theme-next-light.css
@@ -319,6 +319,12 @@
--calendar-coll-event-hover-filter: brightness(.95) saturate(1.25);
--callendar-coll-event-archived-sripe-color: #0000000a;
--calendar-coll-today-background-color: #00000006;
+
+ --task-checkbox-without-state-background: #d5d5d5;
+ --task-checkbox-with-state-background: gray;
+ --task-checkbox-done-color: green;
+ --task-checkbox-unknown-state-color: orange;
+ --task-checkbox-glyph-color: white;
}
#left-pane .fancytree-node.tinted,
@@ -370,4 +376,8 @@
.note-tooltip.with-hue {
--tooltip-background-color: hsl(var(--custom-color-hue), 56%, 96%);
+}
+
+[data-trilium-task-state] {
+ --task-state-adjusted-color: hsl(var(--task-state-hue), 50%, 50%);
}
\ No newline at end of file