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
This commit is contained in:
Abdo 2022-10-08 00:19:28 +03:00
parent b41ac7ae1d
commit 30394c02d5

View File

@ -79,6 +79,7 @@ class EditorPreview(object):
bodyclass = theme_manager.body_classes_for_card_ord(c.ord, mw.pm.night_mode()) bodyclass = theme_manager.body_classes_for_card_ord(c.ord, mw.pm.night_mode())
else: else:
bodyclass = theme_manager.body_classes_for_card_ord(c.ord) bodyclass = theme_manager.body_classes_for_card_ord(c.ord)
bodyclass += " editor-preview"
return f"_showAnswer({json.dumps(a)},'{bodyclass}');" return f"_showAnswer({json.dumps(a)},'{bodyclass}');"