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

Invert colors on selection #75

Closed
Tyriar opened this issue Jun 2, 2016 · 7 comments
Closed

Invert colors on selection #75

Tyriar opened this issue Jun 2, 2016 · 7 comments
Labels
type/enhancement Features or improvements to existing features

Comments

@Tyriar
Copy link
Member

Tyriar commented Jun 2, 2016

This would make it easier to read in addition to just being plain cool

/* blink/webkit */
.element::selection {
  color: fg;
  background-color: bg;
}
/* -moz-selection (probably deprecated) */

image

@Tyriar
Copy link
Member Author

Tyriar commented Jun 2, 2016

Something like this would certainly be a lot easier to implement if the colors were still set via javascript instead of CSS.

@parisk
Copy link
Contributor

parisk commented Jun 2, 2016

That's true, but I think the better solution to combine both is to use a preprosessor like SCSS.

@parisk parisk added the type/enhancement Features or improvements to existing features label Jun 2, 2016
@Tyriar
Copy link
Member Author

Tyriar commented Jun 9, 2016

Even with a preprocessor, if the consumer wants to support more themes than are available they need to write all the styles themselves. If this is considered a feature, they will have to write the ::selection rules.

You can see how I put this together with VS Code here, I could probably transform it into a theme addon relatively easily if that's preferable to adding it to xterm.js.

@parisk
Copy link
Contributor

parisk commented Jun 10, 2016

Eventually I am not sure about this. It could make the Terminal look quite weird.

Terminal.app just changes the background of the selection to gray. @Tyriar could you please provide us with a screenshot of how gnome-terminal handles this?

Terminal.app screenshot

image

@Tyriar
Copy link
Member Author

Tyriar commented Jun 10, 2016

It sets fg to bg and bg to fg when selected. The good thing about it is that it's just as readable as the original text.

image

image

@parisk
Copy link
Contributor

parisk commented Jun 13, 2016

I think I tend more towards improving the background highlighting. I think that bg/fg color inversion is not what most users are used to right now.

@Tyriar
Copy link
Member Author

Tyriar commented Jun 26, 2017

Closing in favor of #692

@Tyriar Tyriar closed this as completed Jun 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Features or improvements to existing features
Projects
None yet
Development

No branches or pull requests

2 participants