Skip to content

Commit

Permalink
Merge pull request #71 from scalar-labs/change-mermaid-style
Browse files Browse the repository at this point in the history
Apply centering and Scalar brand colors to Mermaid diagrams
  • Loading branch information
josh-wong authored Nov 3, 2023
2 parents 3a541f4 + b48fa24 commit 4a8df6d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
10 changes: 9 additions & 1 deletion _includes/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,15 @@
$(document).ready(function () {
mermaid.initialize({
startOnLoad:true,
theme: "default",
theme: "base", // Modified the Mermaid theme to match Scalar brand colors, as listed below; originally `theme: "default",` (modified by josh-wong).
themeVariables: {
primaryColor: "#D5EAFF",
primaryTextColor: "#3D4144",
primaryBorderColor: "#2673BB",
lineColor: "#3D4144",
secondaryColor: "#D5EAFF",
tertiaryColor: "#D5EAFF",
}
});
window.mermaid.init(undefined, document.querySelectorAll('.language-mermaid'));
});
Expand Down
2 changes: 1 addition & 1 deletion _layouts/mermaid.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
$(document).ready(function () {
mermaid.initialize({
startOnLoad:true,
theme: "default",
theme: "base",
});
window.mermaid.init(undefined, document.querySelectorAll('.language-mermaid'));
});
Expand Down
9 changes: 8 additions & 1 deletion _sass/minimal-mistakes/_syntax.scss
Original file line number Diff line number Diff line change
Expand Up @@ -348,4 +348,11 @@ figure.highlight {
th, td {
border-bottom: 0;
}
}
}

/* Make Mermaid diagrams centered (added by josh-wong). */
.language-mermaid {
display: block;
margin: auto;
text-align: center;
}

0 comments on commit 4a8df6d

Please sign in to comment.