Skip to content

Build your personal knowledge base with Trilium Notes

client/collections/board: use hover effect for board items

Adorian Doran3d79c00481c7
diff --git a/apps/client/src/stylesheets/theme-next-dark.css b/apps/client/src/stylesheets/theme-next-dark.css
index 729a638e67..eed74b3b00 100644
--- a/apps/client/src/stylesheets/theme-next-dark.css
+++ b/apps/client/src/stylesheets/theme-next-dark.css
@@ -402,6 +402,9 @@
--board-item-background-saturation: 21%;
--board-item-background-lightness: 32%;
+ --board-item-hover-background-saturation: 25%;
+ --board-item-hover-background-lightness: 35%;
+
--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 cb7d8e016f..f34dd17834 100644
--- a/apps/client/src/stylesheets/theme-next-light.css
+++ b/apps/client/src/stylesheets/theme-next-light.css
@@ -401,6 +401,9 @@
--board-item-background-saturation: 100%;
--board-item-background-lightness: 96%;
+ --board-item-hover-background-saturation: 100%;
+ --board-item-hover-background-lightness: 98.5%;
+
--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 1e249b13ee..11b97a0688 100644
--- a/apps/client/src/widgets/collections/board/index.css
+++ b/apps/client/src/widgets/collections/board/index.css
@@ -5,6 +5,9 @@
--board-item-background-saturation: 100%;
--board-item-background-lightness: 96%;
+
+ --board-item-hover-background-saturation: 100%;
+ --board-item-hover-background-lightness: 96%;
}
.board-view {
@@ -229,6 +232,16 @@ body.mobile .board-view-container .board-add-column {
);
}
+/* Each selector adds `:hover` to the one above it, so it outweighs the state it is taking over. */
+.board-view-container .board-column.with-hue .board-note:hover,
+.board-view-container .board-note.with-hue:hover {
+ background-color: hsl(
+ var(--board-item-hue),
+ var(--board-item-hover-background-saturation),
+ var(--board-item-hover-background-lightness)
+ );
+}
+
.board-view-container .board-note:first-of-type {
margin-top: 0;
}