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

Support the style keyword for class diagrams #2408

Closed
kad-beekw opened this issue Oct 14, 2021 · 1 comment · Fixed by #5111
Closed

Support the style keyword for class diagrams #2408

kad-beekw opened this issue Oct 14, 2021 · 1 comment · Fixed by #5111
Assignees
Labels
Graph: Class Status: Approved Is ready to be worked on Type: Enhancement New feature or request

Comments

@kad-beekw
Copy link

Is your feature request related to a problem? Please describe.

It is possible to style nodes in graph diagrams with a style declaration. The same feature is not available for classDiagram diagrams.

Adding support for the style keyword will allow non-technical users to configure the color of nodes and other styling properties. Current solutions rely on changing the CSS context, but this requires deep access to the web page in which the Mermaid diagram is integrated. Regular users cannot make such changes when they are working within a pre-configured web service.

Describe the solution you'd like

Support for the style keyword in classDiagram diagrams.

Describe alternatives you've considered

The alternative is that a separate CSS context is created where the styling is applied. But such CSS contexts cannot be integrated in most existing Markdown environments. They require changes to the overall web page. Most users of existing services do not have the ability to change this.

Additional context

The following works and makes the node yellow:

graph
  style Monkey fill: yellow
Loading

The following does not work and does not generate a diagram:

classDiagram
  style Monkey fill: yellow
Loading
@kad-beekw kad-beekw added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Oct 14, 2021
@ashishjain0512 ashishjain0512 added Area: Development Graph: Class Status: Approved Is ready to be worked on Topic: Styling and removed Status: Triage Needs to be verified, categorized, etc labels Oct 21, 2021
@ludoo
Copy link

ludoo commented Jan 16, 2023

This would make it possible to style class diagrams in GitHub READMEs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Graph: Class Status: Approved Is ready to be worked on Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants