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.

Bug: Missing TPseudoClasses type when extends variants (tailwind.config.js)

See original GitHub issue

Reproduce step: (v1.3.1)

  • add custom variant in tailwind.config.js variants: { borderWidth: ['hover'], },
  • generate new types: tailwindcss-classnames --config tailwind.config.js -o ./src/tailwindcss-classnames.ts

Expected:

All tailwind default TPseudoClasses with extended variants

Actually happening

Only get type for custom variants: export type TPseudoClasses = | 'hover:border' | 'hover:border-0' ...

P/S: Request feature: Generate type for custom plugin

plugins: [require('@tailwindcss/ui')]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
muhammadsammycommented, May 21, 2020

Reproduce step: (v1.3.1)

  • add custom variant in tailwind.config.js variants: { borderWidth: ['hover'], },
  • generate new types: tailwindcss-classnames --config tailwind.config.js -o ./src/tailwindcss-classnames.ts

Expected:

All tailwind default TPseudoClasses with extended variants

Actually happening

Only get type for custom variants: export type TPseudoClasses = | 'hover:border' | 'hover:border-0' ...

Fixed in 423d5ba9ecfd7dc1e6121cd78745eaa222bd933c 👍

1reaction
muhammadsammycommented, May 22, 2020

The “@tailwindcss/plugin” which I use here is just a plugin with custom classes and its not "https://tailwindui.com/. (Maybe it’s a part of tailwindui). https://www.npmjs.com/package/@tailwindcss/ui

I would like to add support for First party plugins. This is what I mean, we can have the types for tw 3rd-party plugin. https://github.com/aniftyco/awesome-tailwindcss#plugins

The postcss-ts-classnames project does exactly this. you will need to add the generated types from postcss-ts-classnames to the this package’s exported classnames function. Maybe will add a feature to the tailwindcss-classnames CLI that does this automatically.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring Variants - Tailwind CSS
Configuring which utility variants are enabled in your project. Overview. The variants section of your tailwind.config.js file is where you control which ...
Read more >
All colors are missing after overriding or extending theme ...
config.js to add some colors to my tailwind setup; Finally I compiled my css file using npx following the tailwind CLI method from...
Read more >
Tailwind CSS classes is not working in my project?
This error is due to tailwind not finding any classes to scan in what it 'thinks' is your HTML code directories.
Read more >
Tailwinds JIT compiler via CDN - Beyond Code
Use the full power of Tailwind CSS' new JIT compiler by including one script tag to your HTML.
Read more >
Setup Tailwind CSS with Webpack - Level Up Coding
Copy the following into postcss.config.js . const tailwindcss = require('tailwindcss');module.exports = { plugins: [
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