-
-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add support for styling Journey Diagram title (color, font-family, and font-size) #6225
base: develop
Are you sure you want to change the base?
feat: Add support for styling Journey Diagram title (color, font-family, and font-size) #6225
Conversation
Co-authored-by: Pranav Mishra <[email protected]>
Co-authored-by: Pranav Mishra <[email protected]>
Co-authored-by: Pranav Mishra <[email protected]>
|
✅ Deploy Preview for mermaid-js ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
commit: |
Co-authored-by: Pranav Mishra <[email protected]>
Hi! I'm I would like to apply some automated changes to this pull request, but it looks like I don't have the necessary permissions to do so. To get this pull request into a mergeable state, please do one of the following two things:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add visual tests that verify the parameters work.
…where within Co-authored-by: Shahir Ahmed <[email protected]>
Co-authored-by: Pranav Mishra <[email protected]>
Co-authored-by: Pranav Mishra <[email protected]>
Co-authored-by: Pranav Mishra <[email protected]>
@sidharthv96 We’ve implemented the requested changes: ✅ Optimized ✅ Added visual tests – We've included a test to verify that the User Journey Diagram title correctly applies the expected color, font family, and font size based on Let us know if you have any feedback! @pranavm2109 and I appreciate your guidance. |
Co-authored-by: Pranav Mishra <[email protected]>
Co-authored-by: Pranav Mishra <[email protected]>
Co-authored-by: Pranav Mishra <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6225 +/- ##
=======================================
Coverage 4.47% 4.47%
=======================================
Files 385 384 -1
Lines 54191 54186 -5
Branches 598 626 +28
=======================================
+ Hits 2425 2427 +2
+ Misses 51766 51759 -7
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Hey @sidharthv96, this PR is good to go—passes all GitHub Actions checks and CI/CD tests! |
Hi @sidharthv96, is there anything else that remains to be done on our end? If not, could this PR please be merged? |
@pranavm2109 @Shahir-47 please check the allow edit by maintainers for this PR. |
Just enabled it—sorry about that! Let me know if it works now. |
@pranavm2109 and I can look into that and fix it in a separate PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I just noticed that the global themevariable was the one being updated, for a diagram specific change, that shouldn't be the case. Please add them to the diagram's config.
| titleColor | calculated from textColor | Color to be used for the title text in Journey Diagrams. | | ||
| titleFontFamily | trebuchet ms, verdana, arial | Font family to be used for the title text in Journey Diagrams. | | ||
| titleFontSize | 16px | Font size in pixels to be used for the title text in Journey Diagrams. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't have diagram specific variables in the main config.
Please add them to the diagram's config, which you can find in packages/mermaid/src/schemas/config.schema.yaml
📑 Summary
This PR introduces additional customization options for the title in Journey Diagrams. Users can now define
titleColor
,titleFontFamily
, andtitleFontSize
in thethemeVariables
configuration to style the title's color, font family, and font size. If these properties are not defined, they default totextColor
,"trebuchet ms, verdana, arial, sans-serif"
, and16px
, respectively. The feature includes corresponding updates in the rendering logic and documentation.Resolves #3508
📏 Design Decisions
New Theme Variables:
titleColor
: Sets the color of the Journey Diagram title. Defaults totextColor
.titleFontFamily
: Sets the font family for the title. Defaults to"trebuchet ms, verdana, arial, sans-serif"
.titleFontSize
: Sets the font size for the title. Defaults to16px
.Renderer Updates:
getConfig()
and applies them during rendering.Default Values:
packages/mermaid/src/themes/theme-default.js
:Documentation Updates:
packages/mermaid/src/docs/config/theming.md
to includetitleColor
,titleFontFamily
, andtitleFontSize
.📋 Tasks
Make sure you
MERMAID_RELEASE_VERSION
is used for all new features.pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Updated Documentation
File Updated:
packages/mermaid/src/docs/config/theming.md
Added the following rows to the Theme Variables table:
Example Configuration
Users can customize the Journey Diagram title using the following configuration:
With this configuration, the title "User Journey Example" will have a yellow color,
Arial
font, and20px
font size.