summaryrefslogtreecommitdiff
path: root/css/post/mermaid.css
diff options
context:
space:
mode:
authori-shm <[email protected]>2026-08-18 13:06:55 +0000
committeri-shm <[email protected]>2026-08-18 13:06:55 +0000
commit74e7cbcd44fc8923740838b378f600d14be7e8ff (patch)
tree937960995298a86a920d55fe9d1ab9eef737879a /css/post/mermaid.css
parentef479f5b188c64f6edf98805a8271f2c820172c9 (diff)
downloadblog-74e7cbcd44fc8923740838b378f600d14be7e8ff.tar.gz
deploy: 410346c15dffdc48b6b8e6c04bdcb48bab48bd85
Diffstat (limited to 'css/post/mermaid.css')
-rw-r--r--css/post/mermaid.css88
1 files changed, 88 insertions, 0 deletions
diff --git a/css/post/mermaid.css b/css/post/mermaid.css
index e69de29b..dc40ad43 100644
--- a/css/post/mermaid.css
+++ b/css/post/mermaid.css
@@ -0,0 +1,88 @@
+.mermaid {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ margin: $margin-l-0 auto;
+ padding: $margin-m-2;
+ background: $color-text-fourth;
+ border: $line-third solid $color-border;
+ border-radius: $margin-s-2;
+ cursor: pointer;
+ transition: all $transition-duration ease;
+ max-width: 100%;
+ overflow: auto;
+ position: relative;
+}
+.mermaid:hover {
+ border-color: $color-accent;
+ box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.1);
+}
+.mermaid::after {
+ content: "点击放大";
+ position: absolute;
+ bottom: $margin-s-2;
+ right: $margin-s-2;
+ font-size: $font-size-post-tag;
+ color: $color-text-secondary;
+ opacity: 0;
+ transition: opacity $transition-duration;
+}
+.mermaid:hover::after {
+ opacity: 1;
+}
+.mermaid svg {
+ max-width: 100%;
+ height: auto;
+}
+.mermaid-modal {
+ display: none;
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background: $color-overlay;
+ z-index: 10000;
+ justify-content: center;
+ align-items: center;
+ padding: $margin-primary;
+}
+.mermaid-modal.active {
+ display: flex;
+}
+.mermaid-modal .mermaid-close {
+ position: absolute;
+ top: $margin-m-2;
+ right: $margin-m-2;
+ width: 3rem;
+ height: 3rem;
+ background: $color-background;
+ border: $line-third solid $color-border;
+ border-radius: 50%;
+ cursor: pointer;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 1.5rem;
+ color: $color-text-primary;
+ transition: all $transition-duration;
+}
+.mermaid-modal .mermaid-close:hover {
+ background: $color-accent;
+ color: $color-background;
+ border-color: $color-accent;
+}
+.mermaid-modal .mermaid-content {
+ max-width: 95vw;
+ max-height: 90vh;
+ overflow: auto;
+ background: $color-background;
+ padding: $margin-l-0;
+ border-radius: $margin-s-2;
+ box-shadow: 0 0.5rem 2rem rgba(0,0,0,0.3);
+}
+.mermaid-modal .mermaid-content svg {
+ display: block;
+ max-width: none;
+ max-height: none;
+}