fix(docs): force ER attribute text color via themeCSS in dark mode#132
Merged
pratyush618 merged 1 commit intomasterfrom May 3, 2026
Merged
fix(docs): force ER attribute text color via themeCSS in dark mode#132pratyush618 merged 1 commit intomasterfrom
pratyush618 merged 1 commit intomasterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #131. The 7-slide schema carousel showed alternating dim text in dark mode — odd rows ended up with washed-out characters that were nearly unreadable.
Root cause
Two compounding issues:
Mermaid's auto-contrast for ER rows. With odd-vs-even row backgrounds set to two slightly different shades (
#1f2024/#272a30), Mermaid's internal heuristics chose different text colors for each — and in dark mode the choice for one of them landed on a low-contrast grey instead of the configuredtextColor.themeVariables.textColordoesn't propagate to ER.attribute-textreliably. The ER renderer uses its own internal class hierarchy (.er.attributeBoxOdd,.er.attributeBoxEven,.er .attribute-text) and doesn't always read fromtextColor. Some Mermaid versions ship hardcoded fills.Fix
Three layers of defense in
docs/src/components/mermaid.tsx:attributeBackgroundColorOddandattributeBackgroundColorEvento the same value (#1f2024dark /#fffffflight). Removes the auto-contrast asymmetry entirely.darkMode: trueflag in dark theme variables. Tells Mermaid which way internal heuristics should lean for any color it auto-picks.themeCSSoverride with!important— explicit CSS injected into every Mermaid SVG forcing.er.entityBox,.er.entityLabel,.er.attributeBoxOdd/Even,.er .attribute-text, and.er textto the right fill colors. Belt-and-suspenders against any Mermaid-version-specific hardcoded values.Light theme keeps a subtle alternation (
#ffffff/#f4f4f5) since the contrast is fine on a light bg.Test plan
pnpm --dir docs types:checkcleanpnpm --dir docs lintcleanpnpm --dir docs buildcleanDeploy Docsjob/docs/architecture/storagein dark mode, flip through all 7 carousel slides — every column (TYPE / NAME / KEY) should be uniformly readable on every row./docs/architecture/job-lifecycle,/docs/architecture/scheduler).