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

Desktop: Adjust the codemirror code block colors for the dark theme #3794

Merged
merged 2 commits into from
Sep 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,27 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
background-color: inherit !important;
border-bottom: 1px dotted #dc322f;
}

/* The default dark theme colors don't have enough contrast with the background */
.cm-s-nord span.cm-comment {
color: #9aa4b6 !important;
}

.cm-s-dracula span.cm-comment {
color: #a1abc9 !important;
}

.cm-s-monokai span.cm-comment {
color: #908b74 !important;
}

.cm-s-material-darker span.cm-comment {
color: #878787 !important;
}

.cm-s-solarized.cm-s-dark span.cm-comment {
color: #8ba1a7 !important;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it something that should be fixed in the theme files directly (eg. themes/nord.ts, etc.)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The theme files control the way Joplin components will look and be coloured but these changes are specific to the codemirror themes. AFAIK these aren't integrated yet.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, that's right. Ideally we'd submit a patch upstream but I don't know how responsive they are so let's add this for now.

}
`));

return () => {
Expand Down