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

Sort classes when using classnames library(way to handle long className strings) #18

Open
VladSez opened this issue Dec 27, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@VladSez
Copy link

VladSez commented Dec 27, 2020

Is there a way to sort tailwind classes if i am using classnames like this?

import classname from 'classnames';

 <div
  className={classname(
      'flex-col',
      'justify-start',
      'flex',
      'items-center',
      'bg-gray-300',
      'py-20',
  )}></div>

The idea is that i want to manage long className strings(to make them start from new line each), but also get autocompletion with Tailwind CSS IntelliSense and sort with prettier-pluging-tailwind. Maybe there is another way of doing this, could someone suggest me?

@VladSez VladSez added the enhancement New feature or request label Dec 27, 2020
@mtford90
Copy link

mtford90 commented Dec 31, 2020

This would be very useful - another common library for this is clsx - I guess a config option that can take the name of the "classnames" library would be appropriate?

@chensusays
Copy link

I would love to see this enhancement! Currently my team is using tailwindcss-classnames

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants