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

missing default types #48

Closed
AdrienLemaire opened this issue Sep 7, 2020 · 3 comments
Closed

missing default types #48

AdrienLemaire opened this issue Sep 7, 2020 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@AdrienLemaire
Copy link

Related to #15 where you fixed the default color type.

 TS2345: Argument of type '"transition"' is not assignable to  parameter of type 'TArg'

I am not setting transition in my config, because it's recommended.

Every section of the config file is optional, so you only have to specify what you'd like to change. Any missing sections will fall back to Tailwind's default configuration.
For most users we encourage you to keep your config file as minimal as possible, and only specify the things you want to customize.

And the transition doc shows the transition property, but tailwindscss-classnames generates the following types:

export type TTransitionProperty = 
  | 'transition-none'
  | 'transition-all'
  | 'transition-default'
  | 'transition-colors'
  | 'transition-opacity'
  | 'transition-shadow'
  | 'transition-transform';

both transition and transition-default should be in the type.

From the theme configuration, I see

You'll notice that using a key of default in the theme configuration created the class rounded with no suffix. This is a common convention in Tailwind supported by many (although not all) of the core plugins.

The fact that it's not supported by all core plugins is annoying, Maybe you can manage a blacklist of plugins, and auto-add the no-suffix type for all plugins not listed in that blacklist?

@muhammadsammy muhammadsammy added the bug Something isn't working label Sep 10, 2020
@muhammadsammy
Copy link
Owner

both transition and transition-default should be in the type.

From the theme configuration, I see

You'll notice that using a key of default in the theme configuration created the class rounded with no suffix. This is a common convention in Tailwind supported by many (although not all) of the core plugins.

The fact that it's not supported by all core plugins is annoying, Maybe you can manage a blacklist of plugins, and auto-add the no-suffix type for all plugins not listed in that blacklist?

The missing transition type has been added. I could remove the default suffix from all types, but this will not be correct for other classes that have the default suffix, so I've opened a discussion on thier repo asking about this.

@muhammadsammy
Copy link
Owner

muhammadsammy commented Sep 20, 2020

The CLI now removes default suffix from all types except those I know to have it (cursor-default).
Classes of transition property don't seem to be keeping the default suffix because the value of default key in transitionProperty in the default tailwind config is the same as for the .transition class.

I will add more here once they list those to have the suffix.
If you know any specific classnames that keep the default suffix, please create a PR!

@muhammadsammy
Copy link
Owner

This issue has been resolved by using 'DEFAULT' for classes that does not have the suffix and using 'default' to kepp the suffix in the classname (tailwindlabs/tailwindcss#2580)

Which is covered by this PR #70

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

2 participants