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

Show inline previews for rgb hex color strings #4678

Open
1 task done
probablykasper opened this issue Jun 18, 2023 · 18 comments
Open
1 task done

Show inline previews for rgb hex color strings #4678

probablykasper opened this issue Jun 18, 2023 · 18 comments
Labels
css CSS styling support editor Feedback for code editing, formatting, editor iterations, etc enhancement [core label] language An umbrella label for all programming languages syntax behaviors tailwind css Tailwind CSS styling framework support

Comments

@probablykasper
Copy link

Check for existing issues

  • Completed

Describe the feature

Show a color preview for languages like CSS and Tailwind.

If applicable, add mockups / screenshots to help present your vision of the feature

VSCode has this, which it calls "color decorators":

image

I use a color highlight extension which enables different styles:
image
image
image
image
image

@JosephTLyons JosephTLyons added editor Feedback for code editing, formatting, editor iterations, etc css CSS styling support and removed triage css CSS styling support labels Jun 25, 2023
@JosephTLyons JosephTLyons transferred this issue from zed-industries/community Jan 24, 2024
@JosephTLyons JosephTLyons mentioned this issue Feb 6, 2024
1 task
@rafatrace
Copy link

This would be amazing. Is it in the roadmap?

@gbrrrl-no
Copy link

That'd be amazing to have. I really use this feature when working with Tailwind

@SergoGansta777
Copy link

Really important feature for me

@OgDev-01
Copy link

OgDev-01 commented May 6, 2024

This is a very important feature for FE devs as we tend to work with colors. Would appreciate if this is added 👌

@christ-offer
Copy link

Was just looking for this myself! +1 on this!

@Moshyfawn Moshyfawn added css CSS styling support language An umbrella label for all programming languages syntax behaviors tailwind css Tailwind CSS styling framework support labels May 26, 2024
@iamnbutler iamnbutler changed the title Color preview and information (CSS, Tailwind etc) Show inline previews for color strings May 27, 2024
@iamnbutler
Copy link
Member

Going to unify any "color preview" issues and point them at this issue.

There is precedent with inlay hints, but I think this is non-trivial to add due to needing to dive into the editor paint/render code.

Happy to support the final design of what previews look like if someone builds the feature and opens a PR.

@kaumac
Copy link

kaumac commented Jun 10, 2024

Looking forward to this one. It's one of the very useful features I had in VSCode that I'm missing on Zed.

@Angelk90
Copy link
Contributor

Screenshot 2024-05-26 alle 14 56 33 Screenshot 2024-05-26 alle 14 53 43

It would be useful if next to the line indicating the color you could see a preview of it, and if necessary also be able to modify it using a picker that is activated when you click on the color.

@7unn3l
Copy link

7unn3l commented Jul 31, 2024

would also be very nice for it to be a per-language togglable feature.

@PlanB007
Copy link

PlanB007 commented Aug 2, 2024

Any update on this feature? Would be very nice to have this feature during FE development.

@notpeter notpeter changed the title Show inline previews for color strings Show inline previews for rgb hex color strings Aug 12, 2024
@NGSpace
Copy link

NGSpace commented Aug 15, 2024

Would be a very nice feature!

@JesusButForGayPeople

This comment was marked as spam.

@cv4x
Copy link

cv4x commented Aug 20, 2024

There are quite a few people watching this topic. Please don't sent out emails/notifications to everyone just to say "me too!" when a simple thumbs-up on the top post would be sufficient.

@TheRedXD
Copy link

Suggestion: I think these colors should show up in CSS and CSS-like languages, but not only that, things like hex colors or 0x notations of colors should show up in basically any language as well. You might want to have it be a setting as well! Someone mentioned something similar here already.

Also, a thin underline might work better with the style of zed, but that means it's harder to figure out what that color actually is at times.

@Kucito
Copy link

Kucito commented Aug 23, 2024

I would absolutely love this feature!

@TheRedXD
Copy link

TheRedXD commented Aug 24, 2024

I would absolutely love this feature!

Please just like the issue, instead of commenting on it. Comment ONLY if you have something to add to it. A few people not following basic common sense like this makes it worse for literally everyone else who wants to add to it.

@uncenter
Copy link
Contributor

Fwiw here is a PR open for the Helix editor that adds color swatches (helix-editor/helix#12308) by supporting the textDocument/documentColor language server protocol method. This solution is language agnostic and puts the responsibility of color detection on the LSP instead of Zed. Might be a helpful reference.

@xfelipetavares

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css CSS styling support editor Feedback for code editing, formatting, editor iterations, etc enhancement [core label] language An umbrella label for all programming languages syntax behaviors tailwind css Tailwind CSS styling framework support
Projects
None yet
Development

No branches or pull requests