From f36cf66538622c1f835babdbfc7298c8902f3c0a Mon Sep 17 00:00:00 2001 From: ikkz Date: Sat, 23 Nov 2024 01:01:29 +0800 Subject: [PATCH] fix: enable scroll for long formula (#13) --- .changeset/hot-pets-march.md | 5 +++++ src/components/field.tsx | 6 +++--- src/global.css | 8 ++++++++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 .changeset/hot-pets-march.md diff --git a/.changeset/hot-pets-march.md b/.changeset/hot-pets-march.md new file mode 100644 index 0000000..2c8bcde --- /dev/null +++ b/.changeset/hot-pets-march.md @@ -0,0 +1,5 @@ +--- +'anki-templates': patch +--- + +Enable scroll for long formula (长公式启用滚动) diff --git a/src/components/field.tsx b/src/components/field.tsx index 8b1060f..ee7b6be 100644 --- a/src/components/field.tsx +++ b/src/components/field.tsx @@ -39,9 +39,9 @@ export const AnkiField: FC<{ ref={attachNode} id={`anki-field-${name}`} className={clsx( - 'anki-field overflow-x-hidden', - 'prose prose-neutral', - 'dark:prose-invert', + 'anki-field', + 'overflow-x-auto', + 'prose prose-neutral dark:prose-invert', styleId, className, )} diff --git a/src/global.css b/src/global.css index 5e07e13..540f65b 100644 --- a/src/global.css +++ b/src/global.css @@ -18,3 +18,11 @@ body { .anki-field p:last-child { margin-bottom: 0 !important; } + +.anki-field { + scrollbar-width: none; +} + +.anki-field::-webkit-scrollbar { + scrollbar-width: none; +}