Jairus Joer
2025-10-28 08c861707b3a473bab663f4bf63f80753ceb8f8e
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
.expand-button {
  position: absolute;
  display: flex;
  float: right;
  padding: 0.4rem;
  margin: 0.3rem;
  right: 0; // NOTE: right will be set in mermaid.inline.ts
  color: var(--gray);
  border-color: var(--dark);
  background-color: var(--light);
  border: 1px solid;
  border-radius: 5px;
  opacity: 0;
  transition: 0.2s;
 
  & > svg {
    fill: var(--light);
    filter: contrast(0.3);
  }
 
  &:hover {
    cursor: pointer;
    border-color: var(--secondary);
  }
 
  &:focus {
    outline: 0;
  }
}
 
pre {
  &:hover > .expand-button {
    opacity: 1;
    transition: 0.2s;
  }
}
 
#mermaid-container {
  position: fixed;
  contain: layout;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: none;
  backdrop-filter: blur(4px);
  background: rgba(0, 0, 0, 0.5);
 
  &.active {
    display: inline-block;
  }
 
  & > #mermaid-space {
    border: 1px solid var(--lightgray);
    background-color: var(--light);
    border-radius: 5px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 80vh;
    width: 80vw;
    overflow: hidden;
 
    & > .mermaid-content {
      padding: 2rem;
      position: relative;
      transform-origin: 0 0;
      transition: transform 0.1s ease;
      overflow: visible;
      min-height: 200px;
      min-width: 200px;
 
      pre {
        margin: 0;
        border: none;
      }
 
      svg {
        max-width: none;
        height: auto;
      }
    }
 
    & > .mermaid-controls {
      position: absolute;
      bottom: 20px;
      right: 20px;
      display: flex;
      gap: 8px;
      padding: 8px;
      background: var(--light);
      border: 1px solid var(--lightgray);
      border-radius: 6px;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      z-index: 2;
 
      .mermaid-control-button {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        padding: 0;
        border: 1px solid var(--lightgray);
        background: var(--light);
        color: var(--dark);
        border-radius: 4px;
        cursor: pointer;
        font-size: 16px;
        font-family: var(--bodyFont);
        transition: all 0.2s ease;
 
        &:hover {
          background: var(--lightgray);
        }
 
        &:active {
          transform: translateY(1px);
        }
 
        // Style the reset button differently
        &:nth-child(2) {
          width: auto;
          padding: 0 12px;
          font-size: 14px;
        }
      }
    }
  }
}