Skip to content
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(gantt): update styles #4930

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 16 additions & 25 deletions packages/mermaid/src/diagrams/gantt/styles.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const getStyles = (options) =>
`
.mermaid-main-font {
font-family: "trebuchet ms", verdana, arial, sans-serif;
font-family: var(--mermaid-font-family);
font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
}

.exclude-range {
fill: ${options.excludeBkgColor};
}
Expand Down Expand Up @@ -45,11 +45,7 @@ const getStyles = (options) =>

.sectionTitle {
text-anchor: start;
// font-size: ${options.ganttFontSize};
// text-height: 14px;
font-family: 'trebuchet ms', verdana, arial, sans-serif;
font-family: var(--mermaid-font-family);

font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
}


Expand All @@ -59,10 +55,11 @@ const getStyles = (options) =>
stroke: ${options.gridColor};
opacity: 0.8;
shape-rendering: crispEdges;
text {
font-family: ${options.fontFamily};
fill: ${options.textColor};
}
}

.grid .tick text {
font-family: ${options.fontFamily};
fill: ${options.textColor};
}

.grid path {
Expand All @@ -89,33 +86,27 @@ const getStyles = (options) =>

.taskText {
text-anchor: middle;
font-family: 'trebuchet ms', verdana, arial, sans-serif;
font-family: var(--mermaid-font-family);
font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
}

// .taskText:not([font-size]) {
// font-size: ${options.ganttFontSize};
// }

.taskTextOutsideRight {
fill: ${options.taskTextDarkColor};
text-anchor: start;
// font-size: ${options.ganttFontSize};
font-family: 'trebuchet ms', verdana, arial, sans-serif;
font-family: var(--mermaid-font-family);

font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
}

.taskTextOutsideLeft {
fill: ${options.taskTextDarkColor};
text-anchor: end;
// font-size: ${options.ganttFontSize};
}


/* Special case clickable */

.task.clickable {
cursor: pointer;
}

.taskText.clickable {
cursor: pointer;
fill: ${options.taskTextClickableColor} !important;
Expand All @@ -134,6 +125,7 @@ const getStyles = (options) =>
font-weight: bold;
}


/* Specific task settings for the sections*/

.taskText0,
Expand Down Expand Up @@ -255,9 +247,8 @@ const getStyles = (options) =>
.titleText {
text-anchor: middle;
font-size: 18px;
fill: ${options.textColor} ;
font-family: 'trebuchet ms', verdana, arial, sans-serif;
font-family: var(--mermaid-font-family);
fill: ${options.titleColor || options.textColor};
font-family: var(--mermaid-font-family, "trebuchet ms", verdana, arial, sans-serif);
}
`;

Expand Down
Loading