-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Use classes instead of inline style for easy styling #24
Comments
I had some idea of being able to paste the svg code and save it as an svg for use in en external program. Maybe you can use the class definiton and the default class for the styling. |
It seems to be allowed within the SVG standard to specify CSS classes inside the SVG. One example: That way it should still fulfill the "copy&paste" scenario. I will look into if the d3 and dagre-d3 supports inserting a CSS header into the SVG. |
Sounds great! Good luck. I think the goal should be that one can take the svg code generated by mermaid, save it to a file and be able to open in svg editor of choice. Good luck! |
Got it working! Have a look at my fork for a working example, I made the test page web_style.html for this purpose. This impact the syntax in the following ways: I noticed that for the odd shape and the diamond, inline styles were set on the shape. Those were removed. |
This looks really good! By fetching the styles you will know that the svg will look the same outside the browser context. I think we need to support the classDef statement needs to be included as well. That should be fairly easy as we get those from the parser. This for not breaking backwards compatability but we can deprecate the statement and remove it later. Looking forward to the pull request. |
Included in release 0.2.16 |
Bumps [eslint](https://github.com/eslint/eslint) from 7.30.0 to 7.31.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](eslint/eslint@v7.30.0...v7.31.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Would be nice to do:
Or there is an easier way?
The text was updated successfully, but these errors were encountered: