### Configure Tailwind module Source: https://github.com/100phlecs/tailwind_formatter/blob/master/README.md Example configuration for the tailwind module in your Elixir config files. ```elixir config :tailwind, version: "3.3.3", default: [ args: ~w( --config=tailwind.config.js --input=css/app.css --output=../_build/assets/out.css ), cd: Path.expand("../assets", __DIR__) ] ``` -------------------------------- ### Support for class lists Source: https://github.com/100phlecs/tailwind_formatter/blob/master/CHANGELOG.md Example of using class lists within a Phoenix component, which is supported as of v0.4.0. ```elixir
``` -------------------------------- ### Force recompile dependencies Source: https://github.com/100phlecs/tailwind_formatter/blob/master/README.md Run this command to force the recompilation of the formatter and trigger the loading of custom classes. ```bash ❯ mix deps.compile tailwind_formatter --force ==> tailwind_formatter Compiling 5 files (.ex) Loading in /path/to/repo/_build/classes.txt. Loading in /path/to/repo/_build/variants.txt. Generated tailwind_formatter app ``` -------------------------------- ### Configure .formatter.exs Source: https://github.com/100phlecs/tailwind_formatter/blob/master/CHANGELOG.md Update the plugins list in .formatter.exs to include TailwindFormatter and Phoenix.LiveView.HTMLFormatter for Elixir v1.15+. ```elixir [ plugins: [TailwindFormatter, Phoenix.LiveView.HTMLFormatter], # ... ] ``` -------------------------------- ### Configure CI for Tailwind Formatter Source: https://github.com/100phlecs/tailwind_formatter/blob/master/README.md Use these steps in your CI pipeline to generate class definitions and verify formatting before running the check. ```yaml - name: Generate classes.txt for tailwind run: mix tailwind default - name: Compile tailwind_formatter plugin run: mix deps.compile tailwind_formatter --force - name: Check code formatting run: mix format --check-formatted ``` -------------------------------- ### Sort string fragments Source: https://github.com/100phlecs/tailwind_formatter/blob/master/CHANGELOG.md Demonstrates how string fragments within Elixir expressions are sorted. ```elixir "#{if true, do: "px-1 bg-white shadow-md"}" ``` -------------------------------- ### Add dependency to mix.exs Source: https://github.com/100phlecs/tailwind_formatter/blob/master/README.md Include the package in your dependencies list within mix.exs, ensuring it is only used in dev and test environments. ```elixir def deps do [ {:tailwind_formatter, "~> 0.4.2", only: [:dev, :test], runtime: false} ] end ``` -------------------------------- ### Extract custom Tailwind configuration Source: https://github.com/100phlecs/tailwind_formatter/blob/master/CHANGELOG.md Inject these lines into tailwind.config.js to enable extraction of custom classes and variants. ```js let { extract } = require("../deps/tailwind_formatter/assets/js") extract(module.exports, "../_build") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.