|
1 | | -.mermaid { |
2 | | - margin: 1rem 0; |
3 | | - overflow-x: auto; |
| 1 | +@reference "../../../../themes/base.css"; |
| 2 | + |
| 3 | +button { |
| 4 | + @apply border-0; |
| 5 | +} |
| 6 | + |
| 7 | +.markdown-mermaid { |
| 8 | + @apply my-4; |
| 9 | +} |
| 10 | + |
| 11 | +.markdown-mermaid__root { |
| 12 | + @apply border border-[rgb(148_163_184/0.3)] rounded-xl bg-[rgb(15_23_42/0.04)] overflow-hidden; |
| 13 | +} |
| 14 | + |
| 15 | +.markdown-mermaid__header { |
| 16 | + @apply flex items-center justify-between gap-3 px-3 py-2 border-b border-b-[rgb(148_163_184/0.22)] bg-[rgb(15_23_42/0.03)]; |
| 17 | +} |
| 18 | + |
| 19 | +.markdown-mermaid__tabs, |
| 20 | +.markdown-mermaid__actions { |
| 21 | + @apply inline-flex items-center gap-1.5 flex-wrap; |
| 22 | +} |
| 23 | + |
| 24 | +.markdown-mermaid__tabs { |
| 25 | + @apply bg-muted text-muted-foreground ring-muted relative h-[calc(var(--spacing)*7.5)] w-fit justify-center rounded-component ring-[3px]; |
| 26 | + @apply gap-0; |
| 27 | +} |
| 28 | + |
| 29 | +.markdown-mermaid__tab { |
| 30 | + @apply text-muted-foreground dark:text-muted-foreground relative z-10 inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 px-2 py-1 text-sm font-medium whitespace-nowrap bg-transparent transition-[color]; |
| 31 | + @apply focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] focus-visible:outline-none; |
| 32 | + @apply disabled:pointer-events-none disabled:opacity-50; |
| 33 | + @apply cursor-pointer; |
| 34 | +} |
| 35 | + |
| 36 | +.markdown-mermaid__action-button { |
| 37 | + @apply text-foreground inline-flex size-8 items-center justify-center rounded-component p-0 outline-none transition-all; |
| 38 | + @apply hover:bg-accent hover:text-accent-foreground hover:dark:bg-accent/50; |
| 39 | + @apply focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]; |
| 40 | + @apply disabled:pointer-events-none disabled:opacity-50; |
| 41 | + @apply cursor-pointer; |
| 42 | +} |
| 43 | + |
| 44 | +.markdown-mermaid__tab.is-active { |
| 45 | + @apply text-foreground; |
| 46 | +} |
| 47 | + |
| 48 | +.markdown-mermaid__tab-indicator { |
| 49 | + @apply bg-background dark:bg-input/30 dark:border-input absolute inset-0 border border-transparent shadow-sm rounded-component; |
| 50 | + @apply transition-[box-shadow,transform,width,height] duration-200; |
| 51 | +} |
| 52 | + |
| 53 | +.markdown-mermaid__action-button svg { |
| 54 | + @apply size-4; |
| 55 | +} |
| 56 | + |
| 57 | +.markdown-mermaid__body { |
| 58 | + @apply relative min-h-[220px]; |
| 59 | +} |
| 60 | + |
| 61 | +.markdown-mermaid__code, |
| 62 | +.markdown-mermaid__image { |
| 63 | + @apply m-0 min-h-[220px] p-3; |
| 64 | +} |
| 65 | + |
| 66 | +.markdown-mermaid__code { |
| 67 | + @apply overflow-auto whitespace-pre font-mono text-[0.8125rem] leading-[1.6]; |
| 68 | +} |
| 69 | + |
| 70 | +.markdown-mermaid__image { |
| 71 | + @apply flex h-[220px] items-stretch justify-stretch overflow-hidden; |
| 72 | +} |
| 73 | + |
| 74 | +.markdown-mermaid__image-inner { |
| 75 | + @apply flex-1 w-full h-[220px] min-h-[220px] flex items-center justify-center overflow-hidden; |
| 76 | +} |
| 77 | + |
| 78 | +.markdown-mermaid__image-inner svg { |
| 79 | + @apply w-full max-w-full h-full max-h-[70vh]; |
| 80 | +} |
| 81 | + |
| 82 | +.markdown-mermaid__root[data-view="image"] .markdown-mermaid__code { |
| 83 | + @apply hidden; |
| 84 | +} |
| 85 | + |
| 86 | +.markdown-mermaid__root[data-view="code"] .markdown-mermaid__image { |
| 87 | + @apply hidden; |
| 88 | +} |
| 89 | + |
| 90 | +.markdown-mermaid__image:fullscreen { |
| 91 | + @apply h-full bg-[rgb(15_23_42/0.92)] p-5; |
| 92 | +} |
| 93 | + |
| 94 | +.markdown-mermaid__image:fullscreen .markdown-mermaid__image-inner { |
| 95 | + @apply h-full; |
| 96 | +} |
| 97 | + |
| 98 | +.markdown-mermaid__image:fullscreen .markdown-mermaid__image-inner svg { |
| 99 | + @apply max-h-[calc(100vh-2.5rem)]; |
4 | 100 | } |
5 | 101 |
|
6 | 102 | .markdown-mermaid-error { |
7 | | - margin: 1rem 0; |
8 | | - border: 1px solid rgb(248 113 113 / 0.4); |
9 | | - border-radius: 0.5rem; |
10 | | - background: rgb(127 29 29 / 0.08); |
11 | | - padding: 0.75rem; |
12 | | - color: rgb(185 28 28); |
13 | | - font-size: 0.875rem; |
14 | | - line-height: 1.5; |
| 103 | + @apply my-4 border border-[rgb(248_113_113/0.4)] rounded-lg bg-[rgb(127_29_29/0.08)] p-3 text-[rgb(185_28_28)] text-sm leading-6; |
15 | 104 | } |
16 | 105 |
|
17 | 106 | .markdown-mermaid-error-title { |
18 | | - font-weight: 600; |
| 107 | + @apply font-semibold; |
19 | 108 | } |
20 | 109 |
|
21 | 110 | .markdown-mermaid-error-message, |
22 | 111 | .markdown-mermaid-error-source { |
23 | | - margin: 0.5rem 0 0; |
24 | | - white-space: pre-wrap; |
25 | | - word-break: break-word; |
26 | | - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; |
| 112 | + @apply mt-2 whitespace-pre-wrap break-words font-mono; |
27 | 113 | } |
28 | 114 |
|
29 | 115 | .markdown-mermaid-error details { |
30 | | - margin-top: 0.5rem; |
| 116 | + @apply mt-2; |
31 | 117 | } |
0 commit comments