summaryrefslogtreecommitdiff
path: root/css/post/mermaid.css
blob: dc40ad43d4e076071a8353b1f26a1d4d5e931a73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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;
}