Remove "forest.css" in Mermaid#1156
Closed
Gowa2017 wants to merge 1 commit intoMacDownApp:masterfrom
Gowa2017:iss1138_del_memriad_css_file
Closed
Remove "forest.css" in Mermaid#1156Gowa2017 wants to merge 1 commit intoMacDownApp:masterfrom Gowa2017:iss1138_del_memriad_css_file
Gowa2017 wants to merge 1 commit intoMacDownApp:masterfrom
Gowa2017:iss1138_del_memriad_css_file
Conversation
Member
|
Both the method 你知道最新的Mermaid怎么改主题么?最好能保持使用Forest主题。 |
Contributor
Author
|
From the mermaid official document, http://mermaid-js.github.io/mermaid/#/mermaidAPI?id=mermaidapi-configuration-defaults, in version 8, we can use var config = {
theme:'default',
logLevel:'fatal',
securityLevel:'strict',
startOnLoad:true
}
mermaid.initialize(config);theme can be http://mermaid-js.github.io/mermaid/#/mermaidAPI?id=theme. |
Member
|
That's nice. I would prefer to do all related things in a single PR.
|
Contributor
Author
|
Now, please close this issue |
schuyler
pushed a commit
to schuyler/macdown3000
that referenced
this pull request
Nov 20, 2025
- Remove mermaid.forest.css loading from MPRenderer.m - Use Mermaid 8.0+ theme API with 'forest' theme in mermaid.init.js - Fixes today's indicator disappearing when dateFormat not set - Fixes x-axis date label overlap in gantt charts This applies the fix from MacDownApp/macdown#1156 which addresses the issue where external CSS interferes with Mermaid's internal theming system. By using the modern theme API, Mermaid's built-in rendering works correctly while maintaining the forest theme appearance. Changes: - Removed mermaidStylesheets property and method - Removed CSS loading from preview rendering path - Removed CSS loading from HTML export path - Added theme: 'forest' to mermaid.initialize() Related to #18
schuyler
pushed a commit
to schuyler/macdown3000
that referenced
this pull request
Nov 20, 2025
- Remove mermaid.forest.css loading from MPRenderer.m - Use Mermaid 8.0+ theme API with 'forest' theme in mermaid.init.js - Fixes today's indicator disappearing when dateFormat not set - Fixes x-axis date label overlap in gantt charts This applies the fix from MacDownApp/macdown#1156 which addresses the issue where external CSS interferes with Mermaid's internal theming system. By using the modern theme API, Mermaid's built-in rendering works correctly while maintaining the forest theme appearance. Changes: - Removed mermaidStylesheets property and method - Removed CSS loading from preview rendering path - Removed CSS loading from HTML export path - Added theme: 'forest' to mermaid.initialize() Related to #18
schuyler
added a commit
to schuyler/macdown3000
that referenced
this pull request
Nov 20, 2025
## Summary This PR fixes Mermaid gantt diagram rendering issues by removing external CSS and using Mermaid's modern theme API. ### Changes Made - Removed `mermaid.forest.css` loading from `MPRenderer.m` - Added `theme: 'forest'` to `mermaid.initialize()` in `mermaid.init.js` - Removed `mermaidStylesheets` property and method - Updated both preview and HTML export paths ### Issues Fixed ✅ Today's indicator line now appears correctly in gantt charts (with and without explicit `dateFormat`) ✅ X-axis date labels no longer overlap ✅ Forest theme appearance preserved ✅ All other Mermaid diagram types continue to work correctly ### Technical Details The root cause was that external CSS (`mermaid.forest.css`) interfered with Mermaid 8.0+'s internal theme system. Modern Mermaid versions expect theme configuration via the JavaScript API, not external stylesheets. This fix: 1. Removes the conflicting external CSS 2. Uses the official theme API (`theme: 'forest'`) 3. Achieves the same visual result with better compatibility This approach follows the fix from MacDownApp/macdown#1156. ### Code Changes **Files Modified:** - `MacDown/Resources/Extensions/mermaid.init.js` (+3 lines) - `MacDown/Code/Document/MPRenderer.m` (-18 lines) **Net Change:** -15 lines ### Testing ✅ **Automated Tests:** All unit tests pass on macOS runner (CI) 📋 **Manual Testing Plan:** Available at `plans/MANUAL_TEST_PLAN_ISSUE_18.md` ### Code Review ✅ **Architectural review:** Approved by Groucho (architectural guidance) ✅ **Code review:** Approved by Chico - MERGE READY ✅ **Documentation review:** Completed by Harpo - No updates needed ✅ **Testing plan:** Provided by Zeppo - Comprehensive manual test plan available ### Manual Testing A comprehensive manual testing plan is available for visual verification: - Gantt charts with and without `dateFormat` - X-axis label spacing and readability - Today's indicator visibility - Forest theme appearance - Other Mermaid diagram types (flowchart, sequence, etc.) - HTML export functionality ### Related Issue Related to #18 --- **Note:** Per project convention, this PR uses "Related to" rather than "Fixes" or "Closes" to avoid auto-closing the issue. Manual verification is recommended before closing the issue. --------- Co-authored-by: Claude <noreply@anthropic.com>
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.
在新版本的Mermaid中已经不需要。而加上这个css文件会影响graphviz里面node的样式
This is unnecessary in new Mermaid. This CSS file will affect node style in Graphviz.
Closes #1138