sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.1k stars 1.27k forks source link

Syntax highlighting in dark theme has less color variation than in light theme #925

Open felixfbecker opened 5 years ago

felixfbecker commented 5 years ago

Thanks to Mojave I got into dark theme again, but I noticed that code is significantly harder to read because it has less color variation in syntax highlighting:

image

image

In light theme, this is red and the keywords in the parameter types are green. In dark theme, they are all the light blue of the rest of the code. Also, in light theme, control-flow keywords like if are green, which is very different from the light blue of the rest of the code. But in dark theme, they are just dark blue, which is a lot less different.

Here is the same snippet in VS Code with the Sourcegraph Dark theme:

image

Note how types are green, and control-flow keywords are purple. This is how the dark theme on Sourcegraph should look like

slimsag commented 5 years ago

To clarify, the fix for this is what I mentioned in https://github.com/sourcegraph/sourcegraph/issues/1341#issuecomment-446302797

Additionally, a theme switcher would help by allowing you to select more arbitrary themes (which would not 'fit in' with the rest of Sourcegraph via a user setting). This is not a fix, but is a related / helpful addition.

AlicjaSuska commented 3 years ago

@jeanduplessis @Joelkw candidate for the accessibility-related work. wdyt?

github-actions[bot] commented 3 years ago

Heads up @jeanduplessis @alicjasuska @felixfbecker - the "team/frontend-platform" label was applied to this issue.

pdubroy commented 3 years ago

Is this still a problem after the redesign?

felixfbecker commented 3 years ago

@pdubroy Yes, the redesign didn't touch the syntax highlighting.

pdubroy commented 3 years ago

Thanks @felixfbecker, I wasn't sure if we were still using the same theme back in 2018 as we are now.

It's also worth noting that some of these colors don't meet AA standards for contrast ratio:

CleanShot 2021-07-02 at 09 33 35

CleanShot 2021-07-02 at 09 33 07

felixfbecker commented 3 years ago

Yep: https://github.com/sourcegraph/sourcegraph/issues/14546