Tailwind (tailwind v0.1.0) View Source

Tailwind is an installer and runner for Tailwind CLI.

Think esbuild but for Tailwind, allowing you to scratch NodeJS from your toolchain entirely.

Profiles

You can define multiple tailwind profiles, each profile configures arguments, current directory and environment variables:

config :tailwind,
  # Version is optional, latest version will automatically be used if not specified.
  version: "3.0.7",
  default: [
    args: ~w(-i input.css -o output.css),
    cd: Path.expand("../assets", __DIR__),
    env: %{"SOME_VAR" => "some value"}
  ]

Tailwind configuration

There are two global configurations for the tailwind application:

  • :version - the expected tailwind cli version
  • :path - the path to find the tailwind cli executable at. By default, it is automatically downloaded and placed inside the _build directory of your current app

Overriding the :path is not recommended, as we will automatically download and manage tailwind for you. But in case you can't download it (for example, you're behind a proxy), you may want to set the :path to a configurable system location.

Link to this section Summary

Functions

Returns the path to the executable. The executable may not be available if it was not yet installed.

Returns the configuration for the given profile. Returns nil if the profile does not exist.

Installs tailwind in your system, if :force is passed the install is always done regardless if the binary already exists.

Installs, if not available, and then runs tailwind. Returns the same as run/2.

Gets the latest version available for Tailwind CLI at the moment of publishing.

Runs the given command with args. The given args will be appended to the configured args. The task output will be streamed directly to stdio. It returns the status of the underlying call.

Link to this section Functions

Returns the path to the executable. The executable may not be available if it was not yet installed.

Returns the configuration for the given profile. Returns nil if the profile does not exist.

Installs tailwind in your system, if :force is passed the install is always done regardless if the binary already exists.

Link to this function

install_and_run(profile, args)

View Source

Installs, if not available, and then runs tailwind. Returns the same as run/2.

Gets the latest version available for Tailwind CLI at the moment of publishing.

Link to this function

run(profile, extra_args)

View Source

Runs the given command with args. The given args will be appended to the configured args. The task output will be streamed directly to stdio. It returns the status of the underlying call.