Selection and selection matches highlight color
It's really hard to tell which is the selected text and which are the selection matches.
@bgashler1 @aeschli
The selection color comes from the monokai theme: rgba(73, 72, 62, 0.5);
The "selection matches" color comes from our css:
.monaco-editor.vs-dark .selectionHighlight {
background-color: rgba(173,214,255,.15);
}
Should we dynamically compute the .selectionHighlight color starting off the theme selection color?
@alexandrudima sorry for my delayed response on this one. I think this raises an even more interesting question. Should we allow themes to modify the editor styles beyond what TextMate standards support?
What if when we convert TextMate themes to VS Code, we add a reference to boilerplate of additional customizations in either JSON or CSS (which are commented out by default). These customizations could include "selection matches" and other VS Code specific things. JSON would be the more conservative approach so that only specific values are further customizable and we don't open up the entire stylesheet to extensions.
Your approach above (computing the .selectionHilight) sounds like a good fix as well (and it's certainly easier and more conservative). I just wanted to throw out one more idea. What are your thoughts? Also, @stevencl what do you think?
The tmTheme editor I've used in the past allows specification of a selection color. Can that value be used?
<dict>
...
<key>settings</key>
<array>
<dict>
<key>settings</key>
<dict>
...
<key>lineHighlight</key>
<string>#3E3D32</string>
<key>selection</key>
<string>#FFEA00</string>
The lineHighlight from themes is already used, for the line highlight :-)
Adding vscode specific settings is a good option, the tmTheme format allows that. No need to change the theme format. However, as there are already hundreds of themes out there, we could also try to compute the missing color for all themes that don't define the new setting. But how would we compute this? In this case, with the theme's selection color being gray we must know that we must rather something colorful to make a difference. But we must not conflict with any other highlights such as the find match and the work highlight. It's tricky.
You could take the RGB difference between background and selection, and use a color that is something like:
- bg + diff/2
- bg - diff/2
or you could just make the text less lighter/darker of the background, if it's a match and not a selection.
@bgashler1 @alexandrudima I'm finding this to be a pretty big annoyance with my theme of choice (One Dark) during what has otherwise my favorite golang code writing experience to date. Is there a workaround/solution for this yet? @bgashler1, your idea of having user defined theme specific settings is pretty much exactly what I would hope for. And you could even make the default the computed value as a guide for the user.
:+1: we should compute all colors from the theme or invent new theme keys and not have any default left overs when switching to a theme.
:+1: on computing colors as a default, but we should also allow theme creators to specify these values explicitly for the theme if they so desire.
@alexandrudima @bgashler1 That sounds awesome. Sensible defaults + the ability to customize via config would be sweet!
I'm not exactly sure how this would work as I haven't contributed to open source before, but is there anything with this issue that I could help with? I see that it's in the March milestones now, so does that mean that someone else has taken it on? If there is any way to contribute back to the project please let me know, I'd love to help out anywhere I can.
(Also, this might show my naiveté, but I assume because you guys both have the "Microsoft member" badge and have vscode right at the top of your repos contributed to that you either work there or are core contributors of some sort, which is why I'm asking you for some guidance in how to contribute. And if I am right about that let me also say thank you for this awesome editor!)
Keep in mind when implementing this that we want to support background color in tmThemes https://github.com/Microsoft/vscode/issues/3429
+1
I would really love to see that. Miss the green higlight from notepad++. With gray the contrast is too low.
+1
+1
+1 please address this issue as it's a possible deal breaker for me
+1 please please fix this.... it's killing me. Tried searching through a minified bootstrap css file and i can't find the matched text. It's horrible
The idea of computing colors is related to #9631
+1
+1
+1