Skip to content

Commit f1e3d42

Browse files
Mermaid 다이어그램 테마 및 스타일 개선
- 다크모드와 라이트모드에 따른 색상 및 스타일 조정 - SVG 배경을 강제로 투명 처리하고 노드 라벨 색상 적용 - 에지 라벨 배경 및 텍스트 색상 강제 적용 - CSS 스타일 개선 및 반응형 디자인 적용
1 parent ce1f701 commit f1e3d42

1 file changed

Lines changed: 92 additions & 59 deletions

File tree

_includes/mermaid.html

Lines changed: 92 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -83,79 +83,77 @@
8383

8484
// 테마에 따른 변수 설정 함수
8585
const getThemeVariables = (isDark) => {
86-
const baseVariables = {
87-
// 투명 배경 설정
88-
background: 'transparent',
89-
mainBkg: 'transparent',
90-
91-
// 폰트 설정
92-
fontFamily: 'Inter, -apple-system, BlinkMacSystemFont, sans-serif',
93-
fontSize: '14px',
94-
};
86+
const baseVariables = {
87+
// 완전 투명 배경 설정
88+
background: 'transparent',
89+
mainBkg: 'transparent',
90+
secondaryBkg: 'transparent',
91+
tertiaryBkg: 'transparent',
92+
93+
// 폰트 설정
94+
fontFamily: 'Inter, -apple-system, BlinkMacSystemFont, sans-serif',
95+
fontSize: '14px',
96+
};
9597

9698
if (isDark) {
9799
return {
98100
...baseVariables,
99-
// 다크모드 색상
100-
primaryColor: '#8b7cf8',
101-
primaryTextColor: '#f7fafc',
102-
primaryBorderColor: '#7c3aed',
101+
// 다크모드 색상 (더 밝고 선명하게)
102+
primaryColor: '#a78bfa',
103+
primaryTextColor: '#ffffff',
104+
primaryBorderColor: '#8b7cf8',
103105

104-
secondaryColor: '#a78bfa',
105-
secondaryTextColor: '#f7fafc',
106-
secondaryBorderColor: '#8b5cf6',
106+
secondaryColor: '#c084fc',
107+
secondaryTextColor: '#ffffff',
108+
secondaryBorderColor: '#a78bfa',
107109

108110
tertiaryColor: '#fbbf24',
109-
tertiaryTextColor: '#1a202c',
111+
tertiaryTextColor: '#ffffff',
110112
tertiaryBorderColor: '#f59e0b',
111113

112-
// 배경과 표면 (투명/반투명)
113-
secondaryBkg: 'rgba(79, 70, 229, 0.1)',
114-
tertiaryBkg: 'rgba(168, 85, 247, 0.1)',
115-
116-
// 텍스트 색상 (다크모드)
117-
textColor: '#f7fafc',
118-
lineColor: '#6b7280',
114+
// 텍스트 색상 (다크모드 - 더 밝게)
115+
textColor: '#ffffff',
116+
lineColor: '#8b7cf8',
119117

120118
// 노트 색상
121-
noteBkgColor: 'rgba(59, 130, 246, 0.15)',
122-
noteTextColor: '#f7fafc',
123-
noteBorderColor: '#3b82f6',
119+
noteBkgColor: 'transparent',
120+
noteTextColor: '#ffffff',
121+
noteBorderColor: '#a78bfa',
124122

125123
// 플로우차트
126-
nodeBorder: '#8b7cf8',
127-
clusterBkg: 'rgba(168, 85, 247, 0.1)',
128-
clusterBorder: '#a78bfa',
129-
defaultLinkColor: '#8b7cf8',
130-
titleColor: '#f7fafc',
131-
nodeTextColor: '#1a202c',
124+
nodeBorder: '#a78bfa',
125+
clusterBkg: 'transparent',
126+
clusterBorder: '#c084fc',
127+
defaultLinkColor: '#a78bfa',
128+
titleColor: '#ffffff',
129+
nodeTextColor: '#ffffff',
132130

133131
// 시퀀스 다이어그램
134-
actorBkg: 'rgba(139, 124, 248, 0.2)',
135-
actorBorder: '#8b7cf8',
136-
actorTextColor: '#f7fafc',
137-
signalColor: '#8b7cf8',
138-
signalTextColor: '#f7fafc',
132+
actorBkg: 'transparent',
133+
actorBorder: '#a78bfa',
134+
actorTextColor: '#ffffff',
135+
signalColor: '#a78bfa',
136+
signalTextColor: '#ffffff',
139137

140138
// 간트 차트
141-
gridColor: '#4b5563',
142-
section0: '#8b7cf8',
143-
section1: '#a78bfa',
139+
gridColor: '#6b7280',
140+
section0: '#a78bfa',
141+
section1: '#c084fc',
144142
section2: '#fbbf24',
145143
section3: '#34d399',
146144

147145
// 파이 차트
148-
pie1: '#8b7cf8',
149-
pie2: '#a78bfa',
146+
pie1: '#a78bfa',
147+
pie2: '#c084fc',
150148
pie3: '#fbbf24',
151149
pie4: '#34d399',
152150
pie5: '#f87171',
153151
pie6: '#60a5fa',
154-
pie7: '#c084fc',
152+
pie7: '#e879f9',
155153
pie8: '#22d3ee',
156154
pie9: '#fb7185',
157155
pie10: '#4ade80',
158-
pie11: '#818cf8',
156+
pie11: '#8b7cf8',
159157
pie12: '#f472b6'
160158
};
161159
} else {
@@ -174,31 +172,27 @@
174172
tertiaryTextColor: '#1a202c',
175173
tertiaryBorderColor: '#e879f9',
176174

177-
// 배경과 표면 (투명/반투명)
178-
secondaryBkg: 'rgba(102, 126, 234, 0.1)',
179-
tertiaryBkg: 'rgba(240, 147, 251, 0.1)',
180-
181175
// 텍스트 색상 (라이트모드)
182176
textColor: '#2d3748',
183-
lineColor: '#cbd5e0',
177+
lineColor: '#667eea',
184178

185179
// 노트 색상
186-
noteBkgColor: 'rgba(102, 126, 234, 0.1)',
180+
noteBkgColor: 'transparent',
187181
noteTextColor: '#2d3748',
188182
noteBorderColor: '#667eea',
189183

190184
// 플로우차트
191185
nodeBorder: '#5a67d8',
192-
clusterBkg: 'rgba(240, 147, 251, 0.1)',
186+
clusterBkg: 'transparent',
193187
clusterBorder: '#e879f9',
194188
defaultLinkColor: '#667eea',
195189
titleColor: '#2d3748',
196-
nodeTextColor: '#1a202c',
190+
nodeTextColor: '#ffffff',
197191

198192
// 시퀀스 다이어그램
199-
actorBkg: 'rgba(102, 126, 234, 0.15)',
193+
actorBkg: 'transparent',
200194
actorBorder: '#5a67d8',
201-
actorTextColor: '#1a202c',
195+
actorTextColor: '#ffffff',
202196
signalColor: '#667eea',
203197
signalTextColor: '#2d3748',
204198

@@ -373,6 +367,7 @@
373367
display: block;
374368
margin: 0 auto;
375369
font-family: var(--font-family, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
370+
background: transparent !important;
376371
}
377372

378373
/* 다이어그램 제목 스타일링 */
@@ -387,12 +382,31 @@
387382
.mermaid .node rect,
388383
.mermaid .node circle,
389384
.mermaid .node polygon {
390-
fill: url(#siteGradient);
391-
stroke: var(--primary-color, #667eea);
392-
stroke-width: 2px;
385+
fill: url(#siteGradient) !important;
386+
stroke: var(--primary-color, #667eea) !important;
387+
stroke-width: 2px !important;
393388
filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
394389
}
395390

391+
/* SVG 배경 강제 투명 처리 */
392+
.mermaid svg rect[fill="#ffffff"],
393+
.mermaid svg rect[fill="white"],
394+
.mermaid svg rect[style*="fill: #ffffff"],
395+
.mermaid svg rect[style*="fill: white"],
396+
.mermaid svg rect[fill="#1a202c"],
397+
.mermaid svg rect[fill="#000000"],
398+
.mermaid svg rect[style*="fill: #1a202c"],
399+
.mermaid svg rect[style*="fill: #000000"] {
400+
fill: transparent !important;
401+
}
402+
403+
/* 노드 라벨 색상 강제 적용 */
404+
.mermaid .nodeLabel {
405+
color: #ffffff !important;
406+
font-weight: 600 !important;
407+
text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
408+
}
409+
396410
/* 그라데이션 정의 */
397411
.mermaid svg defs {
398412
background: transparent;
@@ -414,10 +428,20 @@
414428
.mermaid .nodeLabel,
415429
.mermaid .edgeLabel {
416430
font-family: var(--font-family, 'Inter', sans-serif);
417-
font-weight: 500;
431+
font-weight: 600;
418432
font-size: 14px;
419433
}
420434

435+
/* 에지 라벨 배경 투명 처리 */
436+
.mermaid .edgeLabel rect {
437+
fill: transparent !important;
438+
}
439+
440+
/* 에지 라벨 텍스트 색상 */
441+
.mermaid .edgeLabel .label {
442+
color: var(--text-primary, #2d3748) !important;
443+
}
444+
421445
/* 다크모드 대응 */
422446
[data-theme="dark"] .mermaid,
423447
.dark .mermaid {
@@ -436,6 +460,11 @@
436460
fill: #f7fafc;
437461
}
438462

463+
[data-theme="dark"] .mermaid .edgeLabel .label,
464+
.dark .mermaid .edgeLabel .label {
465+
color: #f7fafc !important;
466+
}
467+
439468
@media (prefers-color-scheme: dark) {
440469
.mermaid {
441470
border: 1px solid rgba(139, 124, 248, 0.3);
@@ -450,6 +479,10 @@
450479
.mermaid .titleText {
451480
fill: #f7fafc;
452481
}
482+
483+
.mermaid .edgeLabel .label {
484+
color: #f7fafc !important;
485+
}
453486
}
454487

455488
/* 반응형 대응 */

0 commit comments

Comments
 (0)