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

Add CSS variables for Mermaid sequence diagrams #5940

Merged

Conversation

sisp
Copy link
Contributor

@sisp sisp commented Sep 1, 2023

I've added CSS variables for Mermaid sequence diagrams to ease customization. I've also improved the note style to align better with the rest of the theme. Except for the note style, all other CSS variables use the previous styles as defaults.

The rationale of the CSS variables is this:

  • Each sequence diagram component has its own namespace --md-mermaid-sequence-<component>-*.
  • *-fg-color maps to text color – seems consistent with existing variable names
  • *-bg-color maps to shape background color (fill)
  • *-border-color maps to shape border color (stroke)
  • *-line-color maps to line color (typically stroke, fill for arrowhead)

I've added a commit for each component to make the changes per component easier to check.

WDYT, @squidfunk @nejch?

Resolves #5824.

@squidfunk
Copy link
Owner

Thanks for the PR! Skimming through the PR, my first reaction is: looks really good! I'll review this PR in the coming days, so we can quickly merge it. Then, we should do the same for all other diagram types ☺️ Would you like to work on this as well?

@sisp
Copy link
Contributor Author

sisp commented Sep 1, 2023

Sounds great! Sure, once you've approved this approach, I can apply it to the other diagram types as well.

@squidfunk
Copy link
Owner

Looks great! We'd be happy to accept PRs for the other diagram types as well ☺️

@squidfunk
Copy link
Owner

Note that for now, we'll not going to advertise it on the docs, because I'm not yet entirely sure about the naming conventions. We might change the naming a little in the end, but for that to know we need the other types. Always better to decide when you see the whole picture. However, we'll ship it now with 9.2.7.

@squidfunk squidfunk merged commit ea53f53 into squidfunk:master Sep 2, 2023
3 checks passed
@sisp sisp deleted the feat/mermaid-sequence-diagram-styles branch September 5, 2023 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mermaid: allow customizing sequence diagram notes node style
2 participants