insanum / obsidian_gruvbox

A gruvbox theme for Obsidian
MIT License
162 stars 38 forks source link

Mermaid sequence diagram sequence numbers unreadable #27

Closed ashemedai closed 1 year ago

ashemedai commented 2 years ago

When using mermaid sequence diagrams in Obsidian with this theme, the numbers used when using sequence numbers are unreadable.

Example:

image

It seems that this can be styled using something like the following (used neutral-orange as a test):

.mermaid .sequenceNumber                                                                                                                                                                                                                                                          {
    filter: invert(42%) sepia(46%) saturate(5880%) hue-rotate(11deg) brightness(97%) contrast(89%);
}

The filter was calculated via this Codepen, found via this SO question. There might be better ways to do this and use the colour variables, but this is far outside my expertise.

But it works:

image

The colour neutral-green also works fairly well:

filter: invert(51%) sepia(84%) saturate(405%) hue-rotate(21deg) brightness(94%) contrast(91%);

image

Alternatively, styling the messageLine0 and leaving the sequenceNumber alone will yield something like this:

.mermaid .messageLine0
{
    filter: invert(51%) sepia(84%) saturate(405%) hue-rotate(21deg) brightness(94%) contrast(91%);
}

image

Do note that there's at least also a messageLine1

insanum commented 2 years ago

This theme has been completely rewritten for Obsidian 0.16. When you get access can you please retest? Even better, submit a pull request with the changes?

ashemedai commented 2 years ago

Will do once it exits insider. And no problem submitting PRs, just wasn't sure what you or others would think of the colours. I did log an upstream issue how the styling options are problematic in Mermaid for these graphs in that it's rather all or nothing.

insanum commented 2 years ago

I took a look at this and have noticed that sequenceNumbers in general look really bad in Obsidian. The are barely visible and contain no wrapping (i.e. circle) with a colored background. This behavior is in the default theme as well.

I'd like to see the default Obsidian fixed first before hacking any changes here.

ashemedai commented 2 years ago

And we went to 1.0 instead. Did not expect that.

I think you are absolutely correct in waiting. I would want to see changes from Mermaid and Obsidian before we can properly tackle that, since the customisability right now is, honestly, abysmal.

For reference, the corresponding issue with the Mermaid project: mermaid-js/mermaid/issues/523

insanum commented 1 year ago

Fixed in the next version. I was able to force the seqnum value to a visible color.