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

Build is missing negative value classnames #350

Open
1 of 2 tasks
ryangoree opened this issue Dec 19, 2021 · 2 comments
Open
1 of 2 tasks

Build is missing negative value classnames #350

ryangoree opened this issue Dec 19, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@ryangoree
Copy link

ryangoree commented Dec 19, 2021

Environment:

  • TailwindCSS version: 3.0.7
  • tailwindcss-classnames version: 3.0.0
  • Node.js version: 16.13.1

Current Behavior

After using the CLI, the build is missing classes prefixed with - (e.g. -mt-8) for negative values.

Expected Behavior

Build should include classes prefixed with -.

How to Reproduce

  1. Install tailwindcss-classnames@latest
  2. Run npx tailwindcss init
  3. Add "generate-css-types": "tailwindcss-classnames" to your package.json scripts.
  4. npm run generate-css-types
  5. Search the resulting tailwindcss-classnames.ts file for '- and find 0 results.

Possible solutions (Optional)

Additional Questions

  • I've searched the issues list and this is not a duplicate
  • I'm willing to fix this error
@ryangoree ryangoree added the bug Something isn't working label Dec 19, 2021
@cqh963852
Copy link

Hi I am new to tailwindcss-classnames. I meet the same problem.

Here is my solution.

Starting with typescript 4.1

We can define a type that would validate the string without actually defining all the options.

stackoverflow

image

image

@BogdanovBogdan
Copy link

BogdanovBogdan commented Jun 29, 2023

Hi I am new to tailwindcss-classnames. I meet the same problem.

Here is my solution.

Starting with typescript 4.1

We can define a type that would validate the string without actually defining all the options.

stackoverflow

image

image

but after the generate-css-types via tailwindcss-classnames, your new type with a negative value will be removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants