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

Selection cannot be seen #2

Open
benogle opened this issue Mar 1, 2014 · 9 comments
Open

Selection cannot be seen #2

benogle opened this issue Mar 1, 2014 · 9 comments

Comments

@benogle
Copy link

benogle commented Mar 1, 2014

You're using background color on the color elements. The selection regions are z-index'd below the text, so when the background color is totally opaque, the selection cannot be seen.

I dont have a great solution right now. Maybe the color should be a bit transparent (.9?) so something changes when it's selected.

Love this package!

@petrbrzek
Copy link
Member

I will try to listen for some event and add more opacity to background color. Dunno what event yet..

@benogle
Copy link
Author

benogle commented Mar 1, 2014

I admittedly havent tried this yet, but what about setting the opacity on the color you use to max of .9?

@MoOx
Copy link

MoOx commented Mar 1, 2014

I'm thinking about an other solution to fix this problem:
what about not highlithing the #hexa, but using a pseudo element instead ? No idea if it's possible with atom, but it can be great to just append a pseudo after (little square) that have the color (this point is also a good idea to eventually trigger a colorpicker) ?

@petrbrzek
Copy link
Member

Update plugin and try it now. It's hiding background if selection occurs.

@benogle
Copy link
Author

benogle commented Mar 1, 2014

Good idea. It sorta works. I would probably take a little different approach, though. You basically need a function that takes one of those nodes and gives you back a screen Range object. Then you can just check to see if that range is in a selection.

Also that selectedTextLen global that's getting checked is super confusing. I'll see if I can write that function next week, and do a little pull req.

@benogle
Copy link
Author

benogle commented Mar 2, 2014

@MoOx I like the idea of a color picker. The little square might be an interesting experiment and work in place of the selection check.

@petrbrzek
Copy link
Member

I've done some code refactoring in last two days and I've started to implement the color square idea.
You can see the the current plugin appearance below. I think it looks fine. It is also prepared for the color picker implementation. Unfortunately, I found that I can't use native color picker <input type="color">. It just doesn't work. :(
Do you know about some simple color picker implementation?
I like the Chrome dev tools color picker for example.

plugin

@MoOx
Copy link

MoOx commented Mar 9, 2014

You should take a look to this plugin https://github.com/thomaslindstrom/color-picker

@MoOx
Copy link

MoOx commented Mar 9, 2014

Just a thing: why the square is after the ; ? Because you can have multiple color (eg: linear-gradient definition)

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

3 participants