-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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?
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 autofix.ci, a bot that automatically fixes trivial issues such as code formatting in pull requests. 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.
const conf = getConfig().journey; | ||
const titleColor = getConfig().themeVariables.titleColor; | ||
const titleFontSize = getConfig().themeVariables.titleFontSize; | ||
const titleFontFamily = getConfig().themeVariables.titleFontFamily; |
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.
Do not call getConfig() every time, call it once, and then use the value in other places.
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.
@sidharthv96 Understood; we (@Shahir-47 and I) will make sure to update this by calling getConfig() once and then using the value in the other places. As for visual/unit testing, could you please direct us to resources that clarify what kinds of visual/unit tests are expected?
📑 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.