Skip to content
This repository was archived by the owner on Jul 16, 2020. It is now read-only.

Add colors to hex codes and built in css color names #7

Closed
wants to merge 1 commit into from

Conversation

runem
Copy link
Owner

@runem runem commented Feb 23, 2019

This pull request introduces vscode color support for hex and color names in css.

screenshot 2019-02-23 at 11 51 12

@herberthobregon
Copy link

When will you upload this update? I look forward to it for a long time hahaha

@runem
Copy link
Owner Author

runem commented Jul 5, 2019

Sorry, I had completely forgotten all about this PR 🙈 At the time I actually did some more work on it, but concluded that I needed to build a bit more complex setup. The reason is that it's not enough just searching the code for regexes and colors like "red, blue, ...", because if you use the word "red" in a non-css-context, it will still show the color picker.

What do you think about starting out with a MVP that only shows the color picker for hex colors? Then in the meantime I can think about how a more complex setup would look like :-)

Right away I'm thinking about two solutions:

  1. Find CSS contexts by searching for css' ... ' and <style>...</style>. This might be fairly easy to implement.

  2. The underlying CSS analyzer (which I use for code completion/diagnostics) already understands CSS. I could extend it so that the vscode plugin could read the location of colors. This would be a bit more difficult to implement.

@herberthobregon
Copy link

Personally I never use colors like "red" or "Blue" in my styles, I always use their HEX
There is no point showing a "red box" next to a word that says explicitly red hahaha.

but if it is very valuable to add a "red box" to the for #cd0000 that at first glance I do not know what color it is

I think solution 1 is the best to have this feature in production

@runem
Copy link
Owner Author

runem commented Aug 9, 2019

This repo has been migrated to a mono-repo called lit-analyzer. I have build support for what we agreed on, and the feature will come out with the next release of lit-plugin. Therefore I'll close this PR now 🎉

@runem runem closed this Aug 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants