Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
style/note: add custom note color CSS variables on the split containers
Adorian Doranc9fae88a86ca
diff --git a/apps/client/src/widgets/note_wrapper.ts b/apps/client/src/widgets/note_wrapper.tsindex d743d9ffa0..9eaed96c77 100644--- a/apps/client/src/widgets/note_wrapper.ts+++ b/apps/client/src/widgets/note_wrapper.ts@@ -63,6 +63,7 @@ export default class NoteWrapperWidget extends FlexContainer<BasicWidget> {this.$widget.addClass(utils.getNoteTypeClass(note.type));this.$widget.addClass(utils.getMimeTypeClass(note.mime));this.$widget.addClass(`view-mode-${this.noteContext?.viewScope?.viewMode ?? "default"}`);+ this.$widget.addClass(note.getColorClass());this.$widget.toggleClass(["bgfx", "options"], note.isOptions());this.$widget.toggleClass("protected", note.isProtected);@@ -93,7 +94,7 @@ export default class NoteWrapperWidget extends FlexContainer<BasicWidget> {const noteId = this.noteContext?.noteId;if (loadResults.isNoteReloaded(noteId) ||- loadResults.getAttributeRows().find((attr) => attr.type === "label" && ["cssClass", "language", "viewType"].includes(attr.name ?? "") && attributeService.isAffecting(attr, this.noteContext?.note))+ loadResults.getAttributeRows().find((attr) => attr.type === "label" && ["cssClass", "language", "viewType", "color"].includes(attr.name ?? "") && attributeService.isAffecting(attr, this.noteContext?.note))) {this.refresh();}