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

feat: ability to copy colors in v4 docs #1945

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ryanhaticus
Copy link

  • Enables the ability to copy colors in the v4 /docs/colors page.
  • Converts oklch to hex as it's more recognizable from a DX perspective. This should be okay because the color palette doesn't utilize values.

Gif:
click-to-copy

Copy link

vercel bot commented Jan 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tailwindcss-com ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 23, 2025 4:26am

Copy link

@tristonarmstrong tristonarmstrong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dude said, "let there be tabs" #REJECTED lol

@DerpyDinosaur
Copy link

Nice looks great 👍🏻

@tristonarmstrong
Copy link

tristonarmstrong commented Jan 23, 2025

Oof @

  • Safari 18.1.1
  • Sequoia 15.1.1 (24B91)
Screen.Recording.2025-01-22.at.11.35.58.PM.mov

@ryanhaticus
Copy link
Author

@philipp-spiess, thoughts on this quality of life change? Perhaps someone with more knowledge regarding Headless UI can fix the issues @tristonarmstrong mentioned.

@philipp-spiess
Copy link
Member

Hey there! Thanks for the contribution. I think it's a good idea to add a tooltip to our color swatches that shows the value and/or the CSS variable name and allows you to quickly copy this value but we'll probably wait to land this to this until we have polished the tooltip experience in general (there are some issues that we don't like on the homepage tooltip too). Let me take a look at this this next week 👍

As a side node: The conversion to hex values here is probably not a good idea. I understand that hex codes are more common but the reason we used oklch(…) is because with Tailwind CSS v4 we are using on a wide-gamut color palette that often contains colors outside of the rgb spectrum. Because the color space of oklch is bigger than that of rgb, it means that converting from one into the other is loosing information and as a result of that you will not end up with the same color.

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

Successfully merging this pull request may close these issues.

4 participants