question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing color from TailwindCSS.

See original GitHub issue

Environment:

  • TailwindCSS version: 3.0.13
  • tailwindcss-classnames version: 3.0.1
  • Node.js version: 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:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
muhammadsammycommented, Jan 14, 2022

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

1reaction
Tarang74commented, Jan 14, 2022

@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:

import { alignItems, classnames } from 'tailwindcss-classnames'; 

It asks me whether I meant to do: TAlignItems. Is this the same?

How would I then use this type inside of the classnames function?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found