Missing color from TailwindCSS.
See original GitHub issueEnvironment:
TailwindCSSversion: 3.0.13tailwindcss-classnamesversion: 3.0.1Node.jsversion: 14.17.4
Current Behavior
The color "bg-zinc-900" is missing in the package?
My TypeScript linter says:
Argument of type '"bg-zinc-900"' is not assignable to parameter of type 'TArg'. # ts(2345)
I get the same error when building the app.
Expected Behavior
The color should be available in the list of allowed class names.
How to Reproduce
Just create a React TSX file and the following should create a warning in your IDE: index.tsx
import ReactDOM from 'react-dom';
import { classnames } from 'tailwindcss-classnames';
ReactDOM.render(
<div
className={classnames(
'bg-zinc-900' // This line will highlight with an error
)}
></div>,
document.getElementById('root')
);
index.html
<!DOCTYPE html>
<html>
<body>
<div id="root"></div>
</body>
</html>
Possible solutions (Optional)
Could it be because of the release failure?
Additional Questions
- I’ve searched the issues list and this is not a duplicate
- I’m willing to fix this error
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
TailwindCSS Missing Colors in Production vs Development
For some reason, when I compile running npm run dev , it will have all the colors configured (for instance, bg-red-100 , bg-red-200...
Read more >After upgrade to 3.0 some colors are missing. #6831 - GitHub
Hello, I've upgraded tailwindcss to v 3.0. I followed the guide and all is well, except I seem to be missing some colors...
Read more >Missing colors in Tailwind : r/laravel - Reddit
I have installed Tailwind as instructed on page and I am missing many colors. I have only handful of background colors. Why is...
Read more >Customizing Colors - Tailwind CSS
Tailwind uses literal color names (like red, green, etc.) and a numeric scale (where 50 is light and 900 is dark) by default....
Read more >Missing Tailwind 3.0 Colors - Questions - Pinegrow forum
Where are the other 14 default Tailwind colors? ... evolution of the multiple frameworks we support (Bootstrap, Foundation, TailwindCSS …) ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

That was a bug that was just fixed in https://github.com/muhammadsammy/tailwindcss-classnames/commit/bc47da3288e7a2784f5ed21abe2494ae7a609376 Please update to the latest version and the error will disappear
@muhammadsammy That makes sense, thank you!
I was going to post another issue but I think it will be easier if I post here, how do I then import the utility functions? I don’t want to use the CLI method (as shown in the README.md) because it builds a CSS file with all 24000 classes. When I do this:
It asks me whether I meant to do:
TAlignItems. Is this the same?How would I then use this type inside of the
classnamesfunction?