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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add background color style to output svg's #214

Merged

Conversation

jg123
Copy link
Contributor

@jg123 jg123 commented Dec 21, 2021

馃搼 Summary

Output svg's have a transparent background which doesn't look good against github's dark mode themed pages. Set the background-color in the style tag of the svg to set the background color to white (default) or whatever a user chooses with the -b option.

Resolves some user requests in this ticket: mermaid-js/mermaid#1553

馃搹 Design Decisions

Shouldn't crash. Tests pass.

馃搵 Tasks

Make sure you

  • 馃摉 have read the contribution guidelines
  • 馃捇 have added unit/e2e tests (if appropriate)
  • 馃敄 targeted master branch

@jg123 jg123 marked this pull request as ready for review December 21, 2021 21:56
@MindaugasLaganeckas
Copy link
Member

@jg123 I am a bit sick at the moment. I will get back to you this or next week. Thank you for your contribution.

@jg123
Copy link
Contributor Author

jg123 commented Jan 4, 2022

Hope you feel better soon!

@MindaugasLaganeckas
Copy link
Member

Thanks for the PR! 馃槃

@linustannnn
Copy link

linustannnn commented Feb 28, 2024

Hi, can you provide an example as to how to adjust the bg color? I'm not sure what you mean by setting the style tag. Is there a way to change it in here:

%%{
  init: {
    'theme': 'base',
    'themeVariables': {
      'primaryColor': '#fff',
      'primaryTextColor': '#000',
      'primaryBorderColor': '#000',
      'lineColor': '#000',
      'secondaryColor': '#fff',
      'secondaryTextColor': '#000',
      'secondaryBorderColor': '#000',
      'tertiaryColor': '#fff',
      'tertiaryTextColor': '#000',
      'tertiaryBorderColor': '#000'
    }}
}%%

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.

None yet

3 participants