-
-
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?
Changes from 17 commits
a30705c
f0a8ccb
3221cbf
16a1a90
03ff28e
384f59e
7c0af38
798fb98
9fb46ae
88a39f8
ffe1bb3
d81ddf2
82d0192
add48da
2fb6ea7
7aef182
9badfe7
80c6b94
eb7289a
99bd0c4
d6376ca
5ed2278
dffa689
3122c3b
4beed96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,9 @@ function drawActorLegend(diagram) { | |
const conf = getConfig().journey; | ||
const LEFT_MARGIN = conf.leftMargin; | ||
export const draw = function (text, id, version, diagObj) { | ||
const conf = getConfig().journey; | ||
const titleColor = conf.titleColor; | ||
const titleFontSize = conf.titleFontSize; | ||
const titleFontFamily = conf.titleFontFamily; | ||
|
||
const securityLevel = getConfig().securityLevel; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using the conf object will cause issues, as it's only initialized during the initial load. |
||
// Handle root and Document for when rendering in sandbox mode | ||
|
@@ -93,9 +95,11 @@ export const draw = function (text, id, version, diagObj) { | |
.append('text') | ||
.text(title) | ||
.attr('x', LEFT_MARGIN) | ||
.attr('font-size', '4ex') | ||
.attr('font-size', titleFontSize) | ||
.attr('font-weight', 'bold') | ||
.attr('y', 25); | ||
.attr('y', 25) | ||
.attr('fill', titleColor) | ||
.attr('font-family', titleFontFamily); | ||
} | ||
|
||
const height = box.stopy - box.starty + 2 * conf.diagramMarginY; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,6 +135,9 @@ The theming engine will only recognize hex colors and not color names. So, the v | |
| background | #f4f4f4 | Used to calculate color for items that should either be background colored or contrasting to the background | | ||
| fontFamily | trebuchet ms, verdana, arial | | | ||
| fontSize | 16px | Font size in pixels | | ||
| 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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove from this file, you removed it from the auto generated file in the previous commit. :) |
||
| primaryColor | #fff4dd | Color to be used as background in nodes, other colors will be derived from this | | ||
| primaryTextColor | calculated from darkMode #ddd/#333 | Color to be used as text color in nodes using `primaryColor` | | ||
| secondaryColor | calculated from primaryColor | | | ||
|
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.
Need to update