Skip to content

Build your personal knowledge base with Trilium Notes

style/note colors: use a more elegant way to retrieve the theme-aware note color

Adorian Doran66f2d0c7dcd4
diff --git a/apps/client/src/services/css_class_manager.ts b/apps/client/src/services/css_class_manager.ts
index 510a044d65..f22dbf4373 100644
--- a/apps/client/src/services/css_class_manager.ts
+++ b/apps/client/src/services/css_class_manager.ts
@@ -44,7 +44,7 @@ function createClassForColor(colorString: string | null) {
}
}
- return clsx(className, colorsWithHue.has(className) && "with-hue");
+ return clsx("use-note-color", className, colorsWithHue.has(className) && "with-hue");
}
function parseColor(color: string) {
diff --git a/apps/client/src/stylesheets/theme-dark.css b/apps/client/src/stylesheets/theme-dark.css
index a356d32fd0..0354e33462 100644
--- a/apps/client/src/stylesheets/theme-dark.css
+++ b/apps/client/src/stylesheets/theme-dark.css
@@ -109,3 +109,6 @@ body .todo-list input[type="checkbox"]:not(:checked):before {
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6) !important;
}
+.use-note-color {
+ --custom-color: var(--dark-theme-custom-color);
+}
\ No newline at end of file
diff --git a/apps/client/src/stylesheets/theme-light.css b/apps/client/src/stylesheets/theme-light.css
index 872e7431fd..0208ed97cb 100644
--- a/apps/client/src/stylesheets/theme-light.css
+++ b/apps/client/src/stylesheets/theme-light.css
@@ -91,4 +91,8 @@ html {
.ck-content a.reference-link > span,
.board-note {
color: var(--light-theme-custom-color, inherit);
+}
+
+.use-note-color {
+ --custom-color: var(--light-theme-custom-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 72271ad2ea..a02bedc2cf 100644
--- a/apps/client/src/stylesheets/theme-next-dark.css
+++ b/apps/client/src/stylesheets/theme-next-dark.css
@@ -308,4 +308,8 @@ body .todo-list input[type="checkbox"]:not(:checked):before {
--modal-background-color: hsl(var(--custom-color-hue), 8.8%, 11.2%);
--modal-border-color: hsl(var(--custom-color-hue), 9.4%, 25.1%);
--promoted-attribute-card-background-color: hsl(var(--custom-color-hue), 13.2%, 20.8%);
+}
+
+.use-note-color {
+ --custom-color: var(--dark-theme-custom-color);
}
\ No newline at end of file