-
Notifications
You must be signed in to change notification settings - Fork 26
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
Make viable for more use cases #108
Comments
This would be hard because not only would you have to define how to capture the classes, but also how to output them in the same format, instead of one long string. |
Exactly, but I believe this could all be done with more regexes (I don't necessarily love regexes either, but this is the least bad way I could come up with so far.
I don't there is much missing here, and that this would cove a lot of cases (see note on the splitting step). The regular option with just |
maybe instead of a regex inside a regex we can have an enum that describes how to get the classes from the capture group, the options would be
then we could use this enum to decide how to write the classes back as well |
And then save which one it was? (
That would also leave room for better extending it at some point if need be Edit: typo |
I don’t think we need them to tell us about the commas. We can just check that without regex. Do you want to take a first swing at this? |
Yeah sure, no promises about the timeframe tho. |
The
custom-regex
option is great, but it's still only possible to use this when the classes can be in a capture group with nothing else but spaces in between them (at least from all I've tried)More options would allow Rustywind to be used when the classes are in the files, not as space-separated lists. This needs more than a simple addition but more reworking of the sorter.
Here is a single example of where it would be nice to use.
classes = ["flex", "flex-col", "rounded-xl", "border", "border-teal-600", "p-4", "w-[var(--rhs-width)]"]
Maybe another regex could be used after we have extracted the part that has all the classes (which is the current settable regex) and another that matches each single classes (although then one would also need to define something like a pre- and suffix for a class entry)
Honestly I do not have a good (UX-wise) way in mind to do that.
If you have a better idea and/or would want this feature in rustywind, I'd be happy to also spend some time on implementation.
The text was updated successfully, but these errors were encountered: