prettier-plugin-tailwindcss icon indicating copy to clipboard operation
prettier-plugin-tailwindcss copied to clipboard

Pretties does not arrange classes not in a "class"

Open espenlg opened this issue 8 months ago • 2 comments

I'm not sure if this have ever worked, but Antler templates (from Statamic CMS) allows for use of classes without them being in a class tag.

Example:

<section>
      {{ layout = switch(
               (flip && index == 0) => "col-start-1 lg:col-start-7 col-end-11 row-start-1 aspect-square lg:aspect-auto h-full object-cover",
               (flip && index == 1) => "col-start-1 col-end-11 lg:col-end-7 aspect-square lg:aspect-[934/740] object-cover row-start-2 lg:row-start-1",
               (!flip && index == 0) => "col-start-1 col-end-11 lg:col-end-5 row-start-2 lg:row-start-1 aspect-square lg:aspect-auto h-full object-cover",
               (!flip && index == 1) => "col-start-1 lg:col-start-5 col-end-11 aspect-square lg:aspect-[934/740] object-cover row-start-1",
               ) }}
        <img class="{{ layout }}" src="{{ url }}" alt="{{ alt }}" />
</section>

Would it be possible for prettier-plugin-tailwindcss to arrange these as well?

espenlg avatar Feb 20 '25 11:02 espenlg