Skip to content

Build your personal knowledge base with Trilium Notes

client/collections/board: restyle the board item background

Adorian Dorance7371e72d16
diff --git a/apps/client/src/stylesheets/theme-next-dark.css b/apps/client/src/stylesheets/theme-next-dark.css
index ff5354fd0f..729a638e67 100644
--- a/apps/client/src/stylesheets/theme-next-dark.css
+++ b/apps/client/src/stylesheets/theme-next-dark.css
@@ -399,6 +399,9 @@
--board-column-with-hue-background-saturation: 14%;
--board-column-with-hue-background-lightness: 23%;
+ --board-item-background-saturation: 21%;
+ --board-item-background-lightness: 32%;
+
--space-usage-donut-selected-saturation: 90%;
--space-usage-donut-selected-lightness: 80%;
}
diff --git a/apps/client/src/stylesheets/theme-next-light.css b/apps/client/src/stylesheets/theme-next-light.css
index fc2e0ca9db..cb7d8e016f 100644
--- a/apps/client/src/stylesheets/theme-next-light.css
+++ b/apps/client/src/stylesheets/theme-next-light.css
@@ -398,6 +398,9 @@
--board-column-with-hue-background-saturation: 26%;
--board-column-with-hue-background-lightness: 86%;
+ --board-item-background-saturation: 100%;
+ --board-item-background-lightness: 96%;
+
--space-usage-donut-selected-saturation: 35%;
--space-usage-donut-selected-lightness: 45%;
diff --git a/apps/client/src/widgets/collections/board/index.css b/apps/client/src/widgets/collections/board/index.css
index ff66beaf16..a3e17c62cd 100644
--- a/apps/client/src/widgets/collections/board/index.css
+++ b/apps/client/src/widgets/collections/board/index.css
@@ -2,6 +2,9 @@
:where(:root) {
--board-column-with-hue-background-saturation: 26%;
--board-column-with-hue-background-lightness: 86%;
+
+ --board-item-background-saturation: 100%;
+ --board-item-background-lightness: 96%;
}
.board-view {
@@ -203,6 +206,28 @@ body.mobile .board-view-container .board-add-column {
font-size: var(--card-font-size);
}
+/* An item takes the hue of the column it stands in... */
+.board-view-container .board-column.with-hue .board-note {
+ --board-item-hue: var(--board-column-custom-hue);
+}
+
+/* ...and its own wherever it has one, the second selector outweighing the column's rule above
+ rather than merely following it. A card wears `with-hue` only for a colour of its own, which is
+ what tells it apart from one inheriting the hue of the note the board is shown in. */
+.board-view-container .board-note.with-hue,
+.board-view-container .board-column.with-hue .board-note.with-hue {
+ --board-item-hue: var(--custom-color-hue);
+}
+
+.board-view-container .board-column.with-hue .board-note,
+.board-view-container .board-note.with-hue {
+ background-color: hsl(
+ var(--board-item-hue),
+ var(--board-item-background-saturation),
+ var(--board-item-background-lightness)
+ );
+}
+
.board-view-container .board-note:first-of-type {
margin-top: 0;
}
@@ -230,7 +255,8 @@ body.mobile .board-view-container .board-add-column {
top: 8px;
inset-inline-end: 4px;
padding: 2px;
- background-color: var(--main-background-color);
+ /* Masks the title it sits over, so it takes the card's own colour rather than the plain one. */
+ background-color: inherit;
}
.board-view-container .board-note:hover {
@@ -242,7 +268,7 @@ body.mobile .board-view-container .board-add-column {
top: 8px;
inset-inline-end: 4px;
color: var(--main-text-color);
- background-color: var(--main-background-color);
+ background-color: inherit;
padding-inline-start: 6px;
}