Skip to content

Build your personal knowledge base with Trilium Notes

client/collections/board: make the selection outline follow the custom hue

Adorian Doran0573ea445963
diff --git a/apps/client/src/stylesheets/theme-next-dark.css b/apps/client/src/stylesheets/theme-next-dark.css
index eed74b3b00..f4d7194f2e 100644
--- a/apps/client/src/stylesheets/theme-next-dark.css
+++ b/apps/client/src/stylesheets/theme-next-dark.css
@@ -405,6 +405,9 @@
--board-item-hover-background-saturation: 25%;
--board-item-hover-background-lightness: 35%;
+ --board-focus-outline-saturation: 60%;
+ --board-focus-outline-lightness: 70%;
+
--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 f34dd17834..66ebb88a3b 100644
--- a/apps/client/src/stylesheets/theme-next-light.css
+++ b/apps/client/src/stylesheets/theme-next-light.css
@@ -404,6 +404,9 @@
--board-item-hover-background-saturation: 100%;
--board-item-hover-background-lightness: 98.5%;
+ --board-focus-outline-saturation: 50%;
+ --board-focus-outline-lightness: 34%;
+
--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 4b93528925..8be70ce8a2 100644
--- a/apps/client/src/widgets/collections/board/index.css
+++ b/apps/client/src/widgets/collections/board/index.css
@@ -7,7 +7,10 @@
--board-item-background-lightness: 96%;
--board-item-hover-background-saturation: 100%;
- --board-item-hover-background-lightness: 96%;
+ --board-item-hover-background-lightness: 98.5%;
+
+ --board-focus-outline-saturation: 55%;
+ --board-focus-outline-lightness: 45%;
}
.board-view {
@@ -245,8 +248,28 @@ body.mobile .board-view-container .board-add-column {
margin-top: 0;
}
+/* The outline of whatever is focused within, taking the hue of the nearest thing that has one: the
+ column for its header and buttons, the card for itself and what it holds. */
+.board-view-container .board-column.with-hue {
+ --board-focus-outline-color: hsl(
+ var(--board-column-custom-hue),
+ var(--board-focus-outline-saturation),
+ var(--board-focus-outline-lightness)
+ );
+}
+
+.board-view-container .board-column.with-hue .board-note,
+.board-view-container .board-note.with-hue {
+ --board-focus-outline-color: hsl(
+ var(--board-item-hue),
+ var(--board-focus-outline-saturation),
+ var(--board-focus-outline-lightness)
+ );
+}
+
.board-view-container :focus {
- outline: 3px solid var(--input-focus-outline-color);
+ /* Falls back where nothing around carries a hue, which is every board until one is coloured. */
+ outline: 3px solid var(--board-focus-outline-color, var(--input-focus-outline-color));
outline-offset: 0;
}