Skip to content

docs(read-diagrams): make crow's-foot ER diagrams dark-mode adaptive - #269

Open
dimitri-yatsenko wants to merge 1 commit into
mainfrom
docs/er-diagrams-dark-mode
Open

docs(read-diagrams): make crow's-foot ER diagrams dark-mode adaptive#269
dimitri-yatsenko wants to merge 1 commit into
mainfrom
docs/er-diagrams-dark-mode

Conversation

@dimitri-yatsenko

Copy link
Copy Markdown
Member

Fixes the crow's-foot ER diagrams on how-to/read-diagrams not adapting to dark mode. (The dj.Diagram outputs on that page already adapt — this is only the four traditional-ERD comparison figures.)

Cause

er-one-to-one.svg, er-one-to-many.svg, er-reference.svg, er-many-to-many.svg are Mermaid erDiagram exports with baked-in light-only colors (fill:#eee/#f4f4f4/white, stroke:#999/#666, black text) and no prefers-color-scheme block — so they stayed light on a dark page, while the dj.Diagram SVGs adapt because they carry that block.

Fix

Inject a @media (prefers-color-scheme: dark) block into each SVG — the same mechanism the dj.Diagram outputs use — remapping every color the four files use (enumerated to be complete): entity panels and rows to navy-tinted darks, rules/relationship lines/crow's-foot markers to grey, text to light. Colors follow dj-brand V1.0 (navy structure, grey secondary) and match the sibling dj.Diagram dark theme. Light mode is byte-for-byte unchanged (block only appended).

Note

Like the dj.Diagram SVGs, this follows the OS prefers-color-scheme. The site's palette auto-selects the dark (slate) scheme under OS-dark, so they move together. A manual palette toggle that overrides the OS setting is a pre-existing limitation shared by all embedded SVGs here, out of scope for this fix.

The four er-*.svg crow's-foot diagrams (Mermaid erDiagram exports) had baked-in
light-only colors and no prefers-color-scheme block, so they stayed light on a
dark page — unlike the dj.Diagram SVGs, which adapt. Inject a
@media (prefers-color-scheme: dark) block into each (same mechanism as the
dj.Diagram outputs), remapping panels/rows/strokes/text to a brand-family dark
palette (navy-tinted panels, grey rules, light text) per dj-brand V1.0. Light
mode is unchanged.
@dimitri-yatsenko dimitri-yatsenko added the documentation Improvements or additions to documentation label Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant