From 30394c02d55441400cddd73e771f2cdc7804de1d Mon Sep 17 00:00:00 2001 From: Abdo Date: Sat, 8 Oct 2022 00:19:28 +0300 Subject: [PATCH] Allow customizing styles via a custom class Previewer-specific styles can now be specified in card templates by targeting the "editor-preview" class. E.g: ``` .editor-preview { font-size: 12px; } ``` Closes #1 --- src/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/__init__.py b/src/__init__.py index 147ae6e..48dfa84 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -79,6 +79,7 @@ class EditorPreview(object): bodyclass = theme_manager.body_classes_for_card_ord(c.ord, mw.pm.night_mode()) else: bodyclass = theme_manager.body_classes_for_card_ord(c.ord) + bodyclass += " editor-preview" return f"_showAnswer({json.dumps(a)},'{bodyclass}');"