View Source mix tailwind.install (tailwind v0.2.2)

Installs Tailwind executable and assets.

$ mix tailwind.install
$ mix tailwind.install --if-missing

By default, it installs 3.2.7 but you can configure it in your config files, such as:

config :tailwind, :version, "3.2.7"

Options

* `--runtime-config` - load the runtime configuration
  before executing command

* `--if-missing` - install only if the given version
  does not exist

* `--no-assets` - does not install Tailwind assets

Assets

Whenever Tailwind is installed, a default tailwind configuration will be placed in a new assets/tailwind.config.js file. See the tailwind documentation on configuration options.

The default tailwind configuration includes Tailwind variants for Phoenix LiveView specific lifecycle classes:

  • phx-no-feedback - applied when feedback should be hidden from the user
  • phx-click-loading - applied when an event is sent to the server on click while the client awaits the server response
  • phx-submit-loading - applied when a form is submitted while the client awaits the server response
  • phx-submit-loading - applied when a form input is changed while the client awaits the server response

Therefore, you may apply a variant, such as phx-click-loading:animate-pulse to customize tailwind classes when Phoenix LiveView classes are applied.