Mermaid-Chart / vscode-mermaid-preview

Previews Mermaid diagrams
MIT License
142 stars 15 forks source link

[request] Add label support for alt and loop #41

Closed asampal closed 6 years ago

asampal commented 7 years ago

It would be nice to have cases and loops show the name provided in the source.

vstirbu commented 7 years ago

Can you provide more details about the situation? Is this happening in mermaid preview mode or in the build-in markdown viewer? Also an example and a screenshot would be nice. Thanks!

asampal commented 7 years ago

Sure, you can see the way alt and loop should look (along with the source) when labeled, here. The plugin currently doesn't display labels. If you can add these labels, please include them for "opt" as well.

image

vstirbu commented 7 years ago

Ok, so for this diagram:

sequenceDiagram
foo->>bar: hello
alt good
  bar->>foo: everything's cool
else bad
  bar->>foo: uh oh
end
loop keep doing it!
  foo->>baz: do it!   
end

I'm getting the following results:

screen shot 2017-09-23 at 6 35 37

screen shot 2017-09-23 at 6 37 07

The caption text is black in the dark theme.

asampal commented 7 years ago

Yup, that's what I'm using - I guess I should've looked harder. It really is close to invisible on my monitor. Could this be changed?

vstirbu commented 7 years ago

I'll notify upstream.

ghost commented 6 years ago

Has there been any progress on this issue?

vstirbu commented 6 years ago

The solution should come from mermaid itself due to the way it handles the CSS.

You might speed things up by commenting on the mermaid issue referenced above.

DesHorsley commented 6 years ago

Hi @vstirbu looks like the upstream issue has been closed, will that solution filter down to the plugin?

vstirbu commented 6 years ago

The issue was not completely fixed upstream, but the api has been extended to allow custom CSS. In the end the custom css for dark theme should be incorporated upstream, although for now we do it here.

.loopText tspan { 
   fill: inherit;
}