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

Text colors are not correct in VSCODE #570

Closed
cilerler opened this issue Sep 7, 2017 · 13 comments
Closed

Text colors are not correct in VSCODE #570

cilerler opened this issue Sep 7, 2017 · 13 comments

Comments

@cilerler
Copy link

cilerler commented Sep 7, 2017

As you can see it in the screenshot, ALT,OPT,LOOP titles are not visible. (text is there, it is just a dark color which makes it very difficult to read on dark theme.)

2017-09-06_22-07-10

@tylerlong
Copy link
Collaborator

Mermaid has a dark theme which is suitable for dark backgrounds. https://unpkg.com/mermaid@7.0.0/dist/mermaid.dark.css

Not sure who developed the VS Code extension. You can tell the author to add a feature to switch mermaid theme.

@mjbvz
Copy link

mjbvz commented Sep 25, 2017

I'm the author of the VSCode mermaid markdown extension. We do use the mermaid.dark.css stylesheet but I still don't see the colors being overridden properly. The root cause seems to be that the generated svg uses an inline style:

screen shot 2017-09-25 at 12 50 35 pm

which overrides the dark css' .looptext and .labelText rules. Are there other steps required to use the dark theme?

@cilerler cilerler reopened this Sep 25, 2017
@tylerlong
Copy link
Collaborator

tylerlong commented Sep 26, 2017

Things have changed since 7.1.0.

https://github.com/mermaidjs/mermaid-live-editor/blob/master/src/index.js#L8

In earlier versions you specify a CSS file. After 7.1.0 you just specify an option. And yes styles are inline. In fact after 7.1.0 we don't provide separate CSS files at all.

You can still use 7.0.0. Then you can simply specify the dark theme css file. It's up to you.

@vstirbu
Copy link

vstirbu commented Sep 26, 2017

Hello, I'm maintaining another vscode mermaid extension and we have the same issue although the extension is selecting correctly the theme: Mermaid-Chart/vscode-mermaid-preview#41.

The extension is using mermaid 7.1.0 so no way to mangle CSS files. We would appreciate if this issue is fixed in mermaid itself, rather than comping with hacks downstream :).

@tylerlong
Copy link
Collaborator

tylerlong commented Sep 26, 2017

For now, is it possible for your guys to add window.mermaid_config = { theme: 'dark' } if you are using 7.1.0 ?

I am still doing lots of refactoring at the moment. If you want the old behavior, just use 7.0.0.

I will figure out the best solution before 8.0.0

Update(2018-03-16):

Latest syntax is mermaid.initialize({ theme: 'dark' }). No more global variables such as window.mermaid_config.

@vstirbu
Copy link

vstirbu commented Sep 26, 2017

For the record, the problem is with the color of the text in the loops and alts in sequence diagrams. Even when using the dark theme, that text is black thus not visible in the dark:
screen shot 2017-09-26 at 20 05 29

Appreciate all the renovation work that you do, and waiting for 8.0.0...

@arjunachala
Copy link

I have used the dark theme of Mermaid. It seems to be working except for the arrows at the end of the connectors. You can see it here:

image

I am using the 7.0 codebase as suggested on this thread. Any help is appreciated. Thank you!

@cilerler
Copy link
Author

cilerler commented Sep 27, 2017

@arjunachala please don't hi-jack the subject. This issue is about text and not shapes. Create another issue for that one please.

@arjunachala
Copy link

sorry about that! opened another issue at - #578

@mjbvz
Copy link

mjbvz commented Oct 9, 2017

I've tried updating the VSCode extension to use 7.1, but even after passing in theme: 'dark' I don't see loops being styled properly.

@tylerlong Side note: using external style vs inline is also preferable for our use case since we allow dynamically changing styles. Not sure how to do that without a re-render currently

@ghost
Copy link

ghost commented Feb 14, 2018

Has there been any progress on this issue?

@tylerlong
Copy link
Collaborator

tylerlong commented Mar 16, 2018

Please try the latest version:
image

Code is:

mermaid.initialize({ theme: 'dark' });

It's not beautiful but I am a developer instead of a UI designer.

And if you want to change the colors, simply change this file and send a PR: https://github.com/knsv/mermaid/blob/master/src/themes/dark/index.scss

You can even create a new theme by creating a new .scss file.

@tylerlong
Copy link
Collaborator

Now it is also possible to write CSS to override CSS in theme: mermaidjs/mermaid.cli#24 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants