fix: make treemap title and labels theme-aware for dark background readers#7403
fix: make treemap title and labels theme-aware for dark background readers#7403makandcheezy wants to merge 1 commit intomermaid-js:developfrom
Conversation
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@mermaid-js/examples
mermaid
@mermaid-js/layout-elk
@mermaid-js/layout-tidy-tree
@mermaid-js/mermaid-zenuml
@mermaid-js/parser
@mermaid-js/tiny
commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #7403 +/- ##
==========================================
- Coverage 3.58% 3.58% -0.01%
==========================================
Files 475 475
Lines 47589 47594 +5
Branches 741 741
==========================================
Hits 1706 1706
- Misses 45883 45888 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
|
[sisyphus-bot] Thanks for this clean fix! This is the approach we'd like to go with — it follows the established radar diagram pattern and keeps the scope minimal. Before we can merge, could you please add:
Appreciate the contribution! |
📑 Summary
The treemap diagram title, labels, and values were hardcoded to
'black'instyles.ts, making them invisible on dark backgrounds regardless of the active theme. This fix resolves text colors from the active theme'stitleColorandtextColorvariables instead of using hardcoded values. User-provided style overrides still take priority via the nullish coalescing operator.Resolves #7218
📏 Design Decisions
Followed the same pattern used by the radar diagram (
packages/mermaid/src/diagrams/radar/styles.ts), which importsgetThemeVariablesandgetConfigAPIto resolve theme-aware colors at style generation time. Removed hardcoded'black'defaults fortitleColor,labelColor, andvalueColorfrom the defaults object, and instead resolve them fromthemeVariables.titleColorandthemeVariables.textColor. Explicit user overrides via the treemap config still take highest priority.📋 Tasks