From b500ebee9817f264270ee4db94e4b313937a481f Mon Sep 17 00:00:00 2001 From: KawaiiZapic Date: Tue, 24 Sep 2024 13:48:48 +0800 Subject: [PATCH] improve: improve mermaid style --- src/style/editor.less | 8 +++++++- src/style/post.less | 11 ++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/style/editor.less b/src/style/editor.less index 00d8d27..382434f 100644 --- a/src/style/editor.less +++ b/src/style/editor.less @@ -3,5 +3,11 @@ } #wmd-preview pre.mermaid { - background: transparent; + &:first-child { + margin-top: 0.5rem; + } + + &[data-processed="true"] { + background: transparent; + } } diff --git a/src/style/post.less b/src/style/post.less index a4e64d2..11a1511 100644 --- a/src/style/post.less +++ b/src/style/post.less @@ -191,7 +191,7 @@ pre.line-numbers { pre.mermaid[data-processed=""] { height: 120px; - font-size: 0; + font-size: 0 !important; overflow: hidden; user-select: none; background-color: rgb(var(--mdui-color-surface-container)); @@ -200,16 +200,25 @@ pre.mermaid[data-processed=""] { display: flex; align-items: center; justify-content: center; + margin-top: 0.5rem; &::after { content: "正在加载Mermaid..."; font-size: 1rem; opacity: 0.6; } + + &:first-child { + margin-top: 0; + } } pre.mermaid[data-processed="true"] { text-align: center; + + & [id^="container-mermaid"][style*="flex"] { + justify-content: center; + } } pre.block-editable {