style/note: add custom note color CSS variables on the split containers

This commit is contained in:
Adorian Doran 2025-12-17 22:48:47 +02:00
parent 231ec39025
commit c9fae88a86

View File

@ -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();
}