镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Document theme keys for property specific colors - #2178

Closed
crswll wants to merge 2 commits into
tailwindlabs:mainfrom
crswll:document-color-groups
Closed

crswll wants to merge 2 commits into
tailwindlabs:mainfrom
crswll:document-color-groups

Conversation

@crswll

@crswll crswll commented Mar 28, 2025 •

Copy link
Copy Markdown

This PR adds a small section to the CustomizingYourThemeColors component to document how to add colors for a certain property specifically.

Verified the prefixes with: https://play.tailwindcss.com/YubNFhoMJN?layout=horizontal

@vercel

vercel Bot commented Mar 28, 2025 •

Copy link
Copy Markdown

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 Mar 28, 2025 0:54am

@crswll crswll changed the title Document specific theme keys Document theme keys for property specific colors Mar 28, 2025
@scottbedard

Copy link
Copy Markdown

Officially supporting these undocumented namespaces would be very helpful!

My team and I would like to use --background-color, --border-color, and --text-color, but are not comfortable doing so yet because it's undocumented. Would tests also be required to officially support these?

Related conversations: tailwindlabs/tailwindcss#17400, tailwindlabs/tailwindcss#17401

philipp-spiess pushed a commit to tailwindlabs/tailwindcss that referenced this pull request Apr 11, 2025
There are several property-specific color variables available to
maintain compatibility with v3. [My team and I would like to use
them](#17400),
but would feel more comfortable if they were formally supported by v4.
This PR adds test coverage for those features.

@RobinMalfait has confirmed that these features are not intended to be
removed, [see conversation here
→](https://discord.com/channels/486935104384532500/546706299010678784/1355213322995110171)

@crswll Has opened a PR here for the related documentation
- tailwindlabs/tailwindcss.com#2178
@gmoniava

gmoniava commented Jun 24, 2025 •

Copy link
Copy Markdown

Related discussion.

@philipp-spiess

Copy link
Copy Markdown
Contributor

Hey! I was looking into this today and prepared an exhaustive list but the full list ends up being extremely long and not really useful so for now we're not going to make changes to the website. I did, however, use my research and upload it to a GitHub Gist so here's the definitive version as of Tailwind CSS v4.1: https://github.com/proxy/gist.github.com/philipp-spiess/83101e0d0fce4d70fa080dbf31560894

Thank you for the PR though!

@crswll

crswll commented Sep 11, 2025

Copy link
Copy Markdown
Author

Nice! Yeah, I compiled a similar one.

I just thought specifically the color based ones would go a long way. I know I use color specific ones regularly.

Did you consider maybe a link to the gist around here or would that be weird? https://tailwindcss.com/docs/theme#default-theme-variable-reference

@rozsazoltan

rozsazoltan commented Sep 14, 2025 •

Copy link
Copy Markdown
Contributor

Nice list 🎉, @philipp-spiess, maybe a link reference your gist should be added in the docs? Quite a lot of people are looking mainly for solutions with --background-color-*, --border-color-*, and --text-color-* (since they don't know these exist, they try to achieve them with --color-{something}-*). Though I'm not sure - Google might already surface it, as there are so many answers related to this, but somehow the question always ends up on GitHub, StackOverflow, or Reddit.

Btw I'm just speaking from memory, but I've answered such questions dozens of times, even before my own PR. I think people are most often looking for the specific color-namespaces.

This branch was successfully deployed

1 active deployment
Preview — 894d5124 Deployed Mar 28, 2025 by vercel[bot]
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.

5 participants