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

Create utility functions to separate classnames by categories #293

Closed
1 task done
muhammadsammy opened this issue Oct 22, 2021 · 7 comments
Closed
1 task done

Create utility functions to separate classnames by categories #293

muhammadsammy opened this issue Oct 22, 2021 · 7 comments
Assignees
Labels
enhancement New feature or request
Projects

Comments

@muhammadsammy
Copy link
Owner

muhammadsammy commented Oct 22, 2021

Summary

This will improve performance of autocompletion in addition to organizing classnames by categories

example:

classnames(
	textColor("text-black", "hover:text-red-600", "active:text-red-800"),
	display("flex", "md:block"),
	flexDirection("flex-row-reverse"),
)
  • I'm willing to implement this feature
@hydRAnger
Copy link

Will there be a chance to define this on/off?
I mean use categories as default, but let the user disable it (then 'show autocompletion of all classnames as early version).

@hydRAnger
Copy link

It's truly conveient, but does the user need to pay more attention to extra information(regularClassGroupKeys)?

@muhammadsammy
Copy link
Owner Author

@hydRAnger
Sorry for the late reply!
The problem is that tailwindcss@v3 has JIT mode on all the time which generates a huge number of classnames that make the generated file over 100mb and TS engine can't handle them, the autocompletion and validation does not work with all classnames loaded at once

@hydRAnger
Copy link

@hydRAnger Sorry for the late reply! The problem is that tailwindcss@v3 has JIT mode on all the time which generates a huge number of classnames that make the generated file over 100mb and TS engine can't handle them, the autocompletion and validation does not work with all classnames loaded at once

@muhammadsammy

got it, thanks for the details.
sure, if so, that seems trade-off we need to accept(at least for this moment).

blooper05 added a commit to blooper05/LGTuMblr-browser-extension that referenced this issue Mar 15, 2022
@muhammadsammy
Copy link
Owner Author

@hydRAnger Hi, I just added more general utility functions like typography and effects that have more classnames. this could be a useful solution.
eg
typography can have all typography subcategory classnames as font size, font weight, text color, etc

#439

@hydRAnger
Copy link

@hydRAnger Hi, I just added more general utility functions like typography and effects that have more classnames. this could be a useful solution. eg typography can have all typography subcategory classnames as font size, font weight, text color, etc

#439

cool! that's brilliant, let me give it a try 💪

@oddFEELING
Copy link

Where do I find the list of all categories

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
V3
  
Done
Development

No branches or pull requests

3 participants