feat(mermaid): add visual indicator for preview on error

This commit is contained in:
Elian Doran 2025-03-22 02:04:25 +02:00
parent f42a89a548
commit 9985e9b623
No known key found for this signature in database

View File

@ -35,6 +35,14 @@ const TPL = `\
margin: 0.1em;
}
.note-detail-split .note-detail-split-preview {
transition: opacity 250ms ease-in-out;
}
.note-detail-split .note-detail-split-preview.on-error {
opacity: 0.5;
}
/* Horizontal layout */
.note-detail-split.split-horizontal > .note-detail-split-second-col {
@ -139,6 +147,7 @@ export default abstract class AbstractSplitTypeWidget extends TypeWidget {
setError(message: string | null | undefined) {
this.$errorContainer.toggleClass("hidden-ext", !message);
this.$preview.toggleClass("on-error", !!message);
this.$errorContainer.text(message ?? "");
}