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 inside functions #201

Open
CEN-Smart opened this issue Jul 16, 2023 · 1 comment
Open

Sort classes inside functions #201

CEN-Smart opened this issue Jul 16, 2023 · 1 comment

Comments

@CEN-Smart
Copy link

Sort classes inside functions
How can we sort classes in a conditional class function.

import classNames from 'classnames'

  <h1 className={classNames(`grid place-items-center min-h-screen`)}>Coming Soon...</h1>
@Mheaus
Copy link

Mheaus commented Oct 11, 2023

This kinda works in headwings settings :

"headwind.classRegex": {
   ...
  "typescriptreact": "(?:\\bclassName\\s*=\\s*[\\\"\\']([_a-zA-Z0-9\\s\\-\\:\\/]+)[\\\"\\'])|(?:\\btw\\s*`([_a-zA-Z0-9\\s\\-\\:\\/]*)`)|(?:\\bclassName\\s*=\\s*(?:[^\\'\\\"\\}]+[\\'\\\"]([_a-zA-Z0-9\\s\\-\\:\\/]+)[\\\"\\'])*)"
}

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

No branches or pull requests

2 participants