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

Multiline breakpoint sorting small to large #27

Open
Collexi-Dev opened this issue May 17, 2024 · 2 comments
Open

Multiline breakpoint sorting small to large #27

Collexi-Dev opened this issue May 17, 2024 · 2 comments
Labels
feature request New feature or request

Comments

@Collexi-Dev
Copy link

It seems like you are sorting multiline breakpoints from none (mobile) -> large -> small, i.e.:

z-1 flex flex-col gap-4
lg:col-span-5 lg:col-start-3 lg:row-span-2 lg:row-start-2
md:col-span-6 md:col-start-2 md:row-span-2 md:row-start-2

While you are more likely to change your styles mobile first and scale up, meaning mobile -> small -> large it would make sense to sort them this way as well, is it possible to make this an opt-in rule?

@schoero schoero added the feature request New feature or request label May 17, 2024
@Collexi-Dev
Copy link
Author

Update: I just noticed the official sorting does go from small to large, since improved only mentions "Same as official but also sorts by data-attributes" I didn't try it at first

@schoero
Copy link
Owner

schoero commented May 17, 2024

I like that suggestion.

Update: I just noticed the official sorting does go from small to large, since improved only mentions "Same as official but also sorts by data-attributes" I didn't try it at first

I have noticed that the official order does not treat variants/modifiers differently than the normal classes. So they sometimes got mixed up in the order.

Example (not necessarily correct)

<img class="
  flex bg-red-500
  md:bg-blue-500
  border
" />

I wanted to always have variants/modifiers at the end, so thats why I added the improved order.

<img class="
  flex bg-red-500 border
  md:bg-blue-500
" />

There are a lot of discussions around sorting tailwind classes recently:

I think there should be more nuanced ways to sort tailwind classes that the current options don't provide, so I will definitely look into this in the future.

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

No branches or pull requests

2 participants