Skip to content

Commit

Permalink
Refactor mermaid themes to use CSS variables, comments
Browse files Browse the repository at this point in the history
  • Loading branch information
robotgryphon committed Nov 23, 2024
1 parent 0095f19 commit 3654b93
Showing 1 changed file with 42 additions and 9 deletions.
51 changes: 42 additions & 9 deletions src/css/mermaid.css
Original file line number Diff line number Diff line change
@@ -1,24 +1,57 @@
/* LIGHT THEME */
html[data-theme="light"] .docusaurus-mermaid-container {
--diagram-red: hsl(10, 40%, 70%);
--diagram-red-stroke: hsl(10, 40%, 60%);

--diagram-yellow: hsl(60, 40%, 70%);
--diagram-yellow-stroke:hsl(60, 40%, 60%);

--diagram-green: hsl(120, 40%, 70%);
--diagram-green-stroke: hsl(120, 40%, 60%);

--diagram-blue: hsl(240, 40%, 70%);
--diagram-blue-stroke: hsl(240, 40%, 60%);
}

/* DARK THEME */
html[data-theme="dark"] .docusaurus-mermaid-container {
--diagram-red: hsl(10, 40%, 20%);
--diagram-red-stroke: hsl(10, 40%, 30%);

--diagram-yellow: hsl(60, 40%, 20%);
--diagram-yellow-stroke:hsl(60, 40%, 30%);

--diagram-green: hsl(120, 40%, 20%);
--diagram-green-stroke: hsl(120, 40%, 30%);

--diagram-blue: hsl(240, 40%, 20%);
--diagram-blue-stroke: hsl(240, 40%, 30%);
}

/* ==== DO NOT EDIT BELOW IF YOU ARE EDITING COLORS, USE THE VARIABLES ==== */

/* Flowcharts / Graphs */
.docusaurus-mermaid-container .red > rect {
fill: #c99 !important;
stroke: #a77 !important;
fill: var(--diagram-red, #c99) !important;
stroke: var(--diagram-red-stroke, #a77) !important;
stroke-width: 2px !important;
}

.docusaurus-mermaid-container .green > rect {
fill: #9c9 !important;
stroke: #7a7 !important;
fill: var(--diagram-green, #9c9) !important;
stroke: var(--diagram-green-stroke, #7a7) !important;
stroke-width: 2px !important;
}

.docusaurus-mermaid-container .blue > rect {
fill: #99c !important;
stroke: #77a !important;
fill: var(--diagram-blue, #99c) !important;
stroke: var(--diagram-blue-stroke, #77a) !important;
stroke-width: 2px !important;
}

.docusaurus-mermaid-container .highlighted > rect {
fill: #cc9 !important;
stroke: #aa7 !important;
.docusaurus-mermaid-container .highlighted > rect,
.docusaurus-mermaid-container .yellow > rect {
fill: var(--diagram-yellow, #cc9) !important;
stroke: var(--diagram-yellow-stroke, #aa7) !important;
stroke-width: 2px !important;
}

1 comment on commit 3654b93

@neoforged-pages-deployments
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploying with Cloudflare Pages

Name Result
Last commit: 3654b93ca48a874242306977213219df39a3451b
Status: ✅ Deploy successful!
Preview URL: https://e94ecae2.neoforged-docs-previews.pages.dev
PR Preview URL: https://pr-201.neoforged-docs-previews.pages.dev

Please sign in to comment.