mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-11-04 04:44:08 +01:00 
			
		
		
		
	#1693 Added support for custom cssClass and styling to classDiagram-v2
This commit is contained in:
		@@ -16,21 +16,63 @@
 | 
			
		||||
      .mermaid2 {
 | 
			
		||||
        display: none;
 | 
			
		||||
      }
 | 
			
		||||
      .customCss > rect, .customCss{
 | 
			
		||||
        fill:#FF0000 !important;
 | 
			
		||||
        stroke:#FFFF00 !important;
 | 
			
		||||
        stroke-width:4px !important;
 | 
			
		||||
    }
 | 
			
		||||
    </style>
 | 
			
		||||
  </head>
 | 
			
		||||
  <body>
 | 
			
		||||
    <h1>info below</h1>
 | 
			
		||||
      <div class="mermaid" style="width: 100%; height: 20%;">
 | 
			
		||||
    <div class="mermaid" style="width: 100%; height: 20%;">
 | 
			
		||||
      %%{init: {'theme': 'base',  'fontFamily': 'courier', 'themeVariables': {  'primaryColor': '#fff000'}}}%%
 | 
			
		||||
      classDiagram
 | 
			
		||||
       class BankAccount{
 | 
			
		||||
        +String owner
 | 
			
		||||
        +BigDecimal balance
 | 
			
		||||
        +deposit(amount) bool
 | 
			
		||||
        +withdrawl(amount) int
 | 
			
		||||
       }
 | 
			
		||||
       cssClass "BankAccount" customCss
 | 
			
		||||
   
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="mermaid" style="width: 100%; height: 20%;">
 | 
			
		||||
      %%{init: {'theme': 'base',  'fontFamily': 'courier', 'themeVariables': {  'primaryColor': '#fff000'}}}%%
 | 
			
		||||
      classDiagram-v2
 | 
			
		||||
       class BankAccount{
 | 
			
		||||
        +String owner
 | 
			
		||||
        +BigDecimal balance
 | 
			
		||||
        +deposit(amount) bool
 | 
			
		||||
        +withdrawl(amount) int
 | 
			
		||||
       }
 | 
			
		||||
       cssClass "BankAccount" customCss
 | 
			
		||||
   
 | 
			
		||||
    </div>
 | 
			
		||||
      <div class="mermaid2" style="width: 100%; height: 20%;">
 | 
			
		||||
        %%{init: {'theme': 'base',  'fontFamily': 'courier', 'themeVariables': {  'primaryColor': '#fff000'}}}%%
 | 
			
		||||
        classDiagram-v2
 | 
			
		||||
        classDiagram
 | 
			
		||||
         class BankAccount{
 | 
			
		||||
          +String owner
 | 
			
		||||
          +BigDecimal balance
 | 
			
		||||
          +deposit(amount) bool
 | 
			
		||||
          +withdrawl(amount) int
 | 
			
		||||
      }
 | 
			
		||||
        }
 | 
			
		||||
          Class01~T~ <|-- AveryLongClass : Cool
 | 
			
		||||
          Class03~T~ *-- Class04~T~
 | 
			
		||||
            Class01 : size()
 | 
			
		||||
            Class01 : int chimp
 | 
			
		||||
            Class01 : int gorilla
 | 
			
		||||
            Class08 <--> C2: Cool label
 | 
			
		||||
            class Class10~T~ {
 | 
			
		||||
              <<service>>
 | 
			
		||||
              int id
 | 
			
		||||
              test()
 | 
			
		||||
            }
 | 
			
		||||
            callback Class01 "callback" "A Tooltip"  
 | 
			
		||||
     
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="mermaid" style="width: 100%; height: 20%;">
 | 
			
		||||
      <div class="mermaid2" style="width: 100%; height: 20%;">
 | 
			
		||||
      flowchart TB
 | 
			
		||||
      a_a(Aftonbladet) --> b_b[gorilla]:::apa --> c_c{chimp}:::apa -->a_a
 | 
			
		||||
      a_a --> c --> d_d --> c_c
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user