heybourn / headwind

An opinionated Tailwind CSS class sorter built for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=heybourn.headwind
MIT License
1.38k stars 46 forks source link

Doesn't work with one class per line #83

Open drgarlic opened 4 years ago

drgarlic commented 4 years ago

Hi,

The library is great, though it doesn't work when I have one css class per line (which is in my opinion much cleaner).

Here's my code:

<Image
            src="logo.png"
            alt="Logo Rincent Investigation"
            class="
            mt-4
            mx-auto
            h-10
            w-auto
"/>

Here's the output on save:

<Image
            src="logo.png"
            alt="Logo Rincent Investigation"
            class="w-auto h-10 mx-auto mt-4 "/>

Here's what it should be:

<Image
            src="logo.png"
            alt="Logo Rincent Investigation"
            class="
            w-auto
            h-10
            mx-auto
            mt-4
"/>

Instead of generating a new string with classes it should swap them or maybe add an option for this kind of format.

Is that something that can be done or is there some kind of limitation from VS Code ?

Thank you !

heybourn commented 4 years ago

Could this be done with Prettier? I'm sure it could be added to Headwind but it seems as if it's more of a Prettier preference.

drgarlic commented 4 years ago

Maybe ? I don't use Prettier, wouldn't there be a conflict of which action would go first ?

tmm commented 3 years ago

+1 to this suggestion

thomaskimura commented 3 years ago

Would love to see this.

fultonm commented 2 years ago

I agree, 1 class per line is beautiful and much more readable.

homerjam commented 2 years ago

Theoretically, this could be done with a new line in the replacement option, right? But I guess the indentation could end up wrong