Tailwind_formatter

screenshot of Tailwind_formatter
tailwind

Sorts tailwind classes within elixir projects

Overview:

TailwindFormatter is a mix format plugin designed to sort TailwindCSS classes used in HEEx templates and ~H sigils. This tool, inspired by Tailwind's official Prettier plugin, enhances code organization by following a set of rules while formatting TailwindCSS classes. The formatter requires Elixir v1.15 or later to function properly.

Features:

  • Opinionated Sorting: TailwindFormatter sorts classes based on specific rules, enhancing code readability.
  • Installation Assistance: Provides clear guidelines for adding TailwindFormatter to Elixir projects.
  • Custom TailwindCSS Configuration Support: Allows appending custom TailwindCSS configurations for tailored formatting.
  • Usage Convenience: Performing automatic formatting of Tailwind classes by simply running mix format.
  • Divergence from Original Formatter: Highlights differences in sorting algorithm from the original Tailwind Prettier plugin for Elixir use cases.

Summary:

TailwindFormatter is an efficient tool that simplifies and enhances the formatting of TailwindCSS classes in Elixir projects. By following a set of rules inspired by the original Tailwind Prettier plugin, this formatter improves code organization and readability. Its compatibility with Elixir v1.15 or later and support for custom configurations make it a valuable asset for developers working with TailwindCSS in their projects.

tailwind
Tailwind

Tailwind CSS is a utility-first CSS framework that provides pre-defined classes for building responsive and customizable user interfaces.