From fdfdd67c3ab865f79d6b1f2e75c1353aed117e68 Mon Sep 17 00:00:00 2001
From: Matthias Metelka <62722460+kleinerpirat@users.noreply.github.com>
Date: Wed, 23 Nov 2022 07:37:12 +0100
Subject: [PATCH] Revert to pseudo-element approach for field description
(#2209)
* Revert to pseudo-element approach for field description
to ensure it changes on update.
* Simplify CSS
---
ts/editor/FieldDescription.svelte | 52 -------------------
ts/editor/NoteEditor.svelte | 9 ++--
.../rich-text-input/RichTextInput.svelte | 13 +++++
3 files changed, 16 insertions(+), 58 deletions(-)
delete mode 100644 ts/editor/FieldDescription.svelte
diff --git a/ts/editor/FieldDescription.svelte b/ts/editor/FieldDescription.svelte
deleted file mode 100644
index b45a9ac6c..000000000
--- a/ts/editor/FieldDescription.svelte
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-{#if empty}
-
-
-
-{/if}
-
-
diff --git a/ts/editor/NoteEditor.svelte b/ts/editor/NoteEditor.svelte
index d7889775d..d133fdac9 100644
--- a/ts/editor/NoteEditor.svelte
+++ b/ts/editor/NoteEditor.svelte
@@ -57,7 +57,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import EditorToolbar from "./editor-toolbar";
import type { FieldData } from "./EditorField.svelte";
import EditorField from "./EditorField.svelte";
- import FieldDescription from "./FieldDescription.svelte";
import Fields from "./Fields.svelte";
import { alertIcon } from "./icons";
import ImageOverlay from "./image-overlay";
@@ -437,6 +436,8 @@ the AddCards dialog) should be implemented in the user of this component.
}}
collapsed={fieldsCollapsed[index]}
dupe={cols[index] === "dupe"}
+ --description-font-size="{field.fontSize}px"
+ --description-content={`"${field.description}"`}
>
-
- {field.description}
-
-
+ />
diff --git a/ts/editor/rich-text-input/RichTextInput.svelte b/ts/editor/rich-text-input/RichTextInput.svelte
index 8147d8fa2..57d114dd1 100644
--- a/ts/editor/rich-text-input/RichTextInput.svelte
+++ b/ts/editor/rich-text-input/RichTextInput.svelte
@@ -224,6 +224,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html