Skip to content

fix: 다이어그램 SVG 다크모드 지원#90

Merged
Twodragon0 merged 1 commit intomainfrom
fix/diagram-svg-darkmode
Mar 7, 2026
Merged

fix: 다이어그램 SVG 다크모드 지원#90
Twodragon0 merged 1 commit intomainfrom
fix/diagram-svg-darkmode

Conversation

@Twodragon0
Copy link
Owner

Summary

  • /assets/images/diagrams/ 경로의 24개 라이트 배경 SVG에 다크모드 filter 적용
  • data-theme="dark"prefers-color-scheme Safari fallback 지원
  • 이미 어두운 배경의 SVG (section banners, 포스트 헤더 이미지 등)는 영향 없음

Test plan

  • 다크모드에서 diagram SVG 이미지 색상 반전 확인
  • 라이트모드에서 기존과 동일하게 표시되는지 확인
  • section-*.svg 배너 이미지가 영향받지 않는지 확인

- /assets/images/diagrams/ 경로의 24개 SVG에 다크모드 filter 적용
- data-theme="dark" 및 prefers-color-scheme fallback 지원
- 이미 어두운 배경의 SVG (section-*.svg 등)는 제외
Copilot AI review requested due to automatic review settings March 7, 2026 12:49
@Twodragon0 Twodragon0 merged commit a6110b4 into main Mar 7, 2026
1 check failed
@vercel
Copy link

vercel bot commented Mar 7, 2026

Deployment failed with the following error:

Resource is limited - try again in 14 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/twodragon0s-projects?upgradeToPro=build-rate-limit

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the site’s Mermaid include stylesheet to apply a dark-mode inversion filter to non-Mermaid diagram images under /assets/images/diagrams/, including a Safari/system dark-mode fallback via prefers-color-scheme.

Changes:

  • Add [data-theme="dark"] CSS rule to invert /diagrams/ images in dark mode.
  • Add prefers-color-scheme: dark fallback rule to invert /diagrams/ images when no explicit light theme is set.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +35 to +37
html:not([data-theme="light"]) .post-content img[src*="/diagrams/"] {
filter: invert(1) hue-rotate(180deg);
}
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 선택자 img[src*="/diagrams/"]는 SVG뿐 아니라 PNG(예: /assets/images/diagrams/mermaid_chart_1.png 또는 diagram_.png)까지 매칭될 수 있습니다. PR 설명/제목이 ‘SVG 다크모드’라면, 대상 파일 타입을 .svg로 제한하거나(또는 opt-in 클래스 기반으로) 의도치 않은 래스터 이미지까지 반전되지 않도록 범위를 줄이는 게 안전합니다.

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +26
[data-theme="dark"] .post-content img[src*="/diagrams/"] {
filter: invert(1) hue-rotate(180deg);
}
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

다이어그램 다크모드 처리가 .post-content 내부로만 스코프되어 있는데, 레이아웃에 따라(예: _layouts/page.html.page-content) 동일한 /diagrams/ 이미지가 포함되면 다크모드 반전이 적용되지 않을 수 있습니다. 다이어그램이 포스트 외 페이지/문서에서도 사용된다면 .page-content 등도 포함하거나, 반전 대상 자체에 opt-in 클래스를 부여해 컨테이너 의존성을 없애는 쪽이 일관됩니다.

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +26
/* Dark mode for diagram SVGs (light background, non-mermaid) */
[data-theme="dark"] .post-content img[src*="/diagrams/"] {
filter: invert(1) hue-rotate(180deg);
}
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/assets/images/diagrams/의 SVG들은 현재 다수(사실상 전부)가 배경을 #0d1117 같은 다크 팔레트로 직접 채우고 있습니다(예: assets/images/diagrams/2026-01-24-codex-agent-loop.svg). 이 상태에서 다크모드에 invert()를 일괄 적용하면 오히려 라이트 배경으로 뒤집히고 의미 있는 색상도 반전되어 의도와 반대로 보입니다. 다크모드 반전이 필요한 ‘라이트 배경 다이어그램’에만 적용되도록, 이미지에 opt-in 클래스/속성을 추가하거나(예: class로 구분) 파일명/경로로 대상을 분리한 뒤 그 대상에만 필터를 적용하는 방식으로 범위를 좁혀 주세요.

Copilot uses AI. Check for mistakes.
@Twodragon0 Twodragon0 deleted the fix/diagram-svg-darkmode branch March 9, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants