{"repo":"100phlecs/tailwind_formatter","free":true,"listed":false,"github":"https://github.com/100phlecs/tailwind_formatter","clone":"git clone https://github.com/100phlecs/tailwind_formatter.git","description":"Sorts tailwind classes within elixir projects","language":"Elixir","stars":128,"topics":["elixir","formatter","phoenix","tailwind","tailwindcss"],"license":"MIT","category":"dev-tools","readme_excerpt":"TailwindFormatter This package targets Tailwind CSS v3. For Tailwind v4, use canonical tailwind , which sorts classes via the tailwindcss CLI and Phoenix LiveView's attribute formatters API. Opinionated sorting for TailwindCSS classes used in HEEx templates and H sigils. TailwindFormatter is a mix format plugin that sorts TailwindCSS classes found in your templates. It takes inspiration from Tailwind's official Prettier plugin. Note: This formatter requires Elixir v1.15 or later. Installation Add tailwind formatter to your list of dependencies in mix.exs : Setup TailwindFormatter is most likely to be used alongside Phoenix.LiveView.HTMLFormatter , so it should be installed in a way that allows the HTML formatter to run after the Tailwind formatter. Update your .formatter.exs to include TailwindFormatter . Using Custom TailwindCSS configuration If you are using the standalone tailwind module, you can append these lines to the end of your tailwind.config.js file: This will write a classes.txt and variants.txt to your build/ directory. The second argument within extract may vary depending on the value of cd: in your :tailwind config. The above will work with this configuration, for example: Run mix tailwind default to force it to extract the configuration. Afterward, when you run mix compile you should see TailwindFormatter loading in your custom classes. If you don't, you can run mix deps.compile tailwind formatter --force . Usage After installation and setup, run mix format . ","default_branch":null,"files":null,"tree":[],"storefront":"/r/100phlecs","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/100phlecs/tailwind_formatter/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}