tailwind_formatter icon indicating copy to clipboard operation
tailwind_formatter copied to clipboard

Can we have line breaks?

Open Malien opened this issue 1 year ago • 0 comments

Thanks for the project!

It is unpopular in tailwind circles to space out class names onto multiple lines. But for me it makes navigating the code MUCH easier. (especially in vim)

<button
  class=" flex-none cursor-pointer rounded border-slate-300 bg-white px-4 py-1 shadow-sm shadow-lg light:border hover:border-slate-400 active:bg-gray-100 dark:border-t dark:border-slate-500 dark:bg-slate-800 dark:shadow-indigo-950 dark:hover:bg-slate-700 dark:active:border-slate-900 dark:active:bg-slate-900 "
  id="passkey-create"
>
  Create a passkey to continue
</button>

vs

<button
  class="
    flex-none cursor-pointer rounded border-slate-300 bg-white px-4 py-1 
    shadow-sm shadow-lg light:border hover:border-slate-400 active:bg-gray-100 
    dark:border-t dark:border-slate-500 dark:bg-slate-800 dark:shadow-indigo-950
    dark:hover:bg-slate-700 dark:active:border-slate-900 dark:active:bg-slate-900
  "
  id="passkey-create"
>
  Create a passkey to continue
</button>

When it comes to interplay with class lists, the heuristics aren't simple, but is this something that is worth considering?

Malien avatar Jan 31 '25 12:01 Malien