fix(treemap): use theme-aware color for title text#7404
fix(treemap): use theme-aware color for title text#7404apoorvdarshan wants to merge 2 commits intomermaid-js:developfrom
Conversation
The treemap title color was hardcoded to black, making it unreadable on dark backgrounds. Use themeVariables.titleColor instead so the title adapts to the active theme. Fixes mermaid-js#7218
✅ 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 #7404 +/- ##
==========================================
- Coverage 3.58% 3.58% -0.01%
==========================================
Files 475 476 +1
Lines 47589 47605 +16
Branches 741 741
==========================================
Hits 1706 1706
- Misses 45883 45899 +16
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 ↗︎
|
makandcheezy
left a comment
There was a problem hiding this comment.
Just noting that #7403 was opened 2 hours before this PR and fixes labelColor and valueColor for dark themes as well, not just titleColor. Might want to check that yours doesn't leave labels and values still broken on dark backgrounds. Good luck though!!!
Use themeVariables.textColor for label/value colors and themeVariables.titleColor for title, instead of hardcoding 'black'. This ensures all treemap text is readable on dark themes. Also simplifies the approach by using theme variables already passed through the style system, removing unnecessary config imports.
|
This PR now fixes all three text colors (titleColor, labelColor, valueColor). The key difference from #7403 is that this approach uses the themeVariables object already passed into getStyles by Mermaid's style pipeline (src/styles.ts line 21), rather than re-importing getThemeVariables and getConfigAPI to manually re-fetch config inside the function. This keeps it simpler (no extra imports, fewer intermediate variables) and consistent with how the style system is designed to work. User overrides via the treemap config still take priority through cleanAndMerge. |
|
[sisyphus-bot] Thanks for jumping on this! After reviewing all three PRs for this issue, we're going with #7403 as it follows the established Appreciate the contribution — and feel free to pick up another issue from the backlog! |
|
closing this PR in favor of #7403 |
Summary
titleColor: 'black'withthemeVariables.titleColorso the title adapts to the active theme (same pattern used by the radar diagram)treemapconfig still work as beforeFixes #7218
Test plan
tsc --noEmit)vitest run)pnpm build)titleColoroverride still works