README.md

# rebar3_tailwind

A rebar plugin to trigger tailwind css compilation with `rebar compile`.

## Build

    $ rebar3 compile

## Use

Follow the tailwind [docs](https://tailwindcss.com/docs/installation) to setup tailwind for your project. Specifically, you'll need to install the tailwindcss executable.

Add the plugin to your project's rebar.config:

    {plugins, [rebar3_tailwind]}.

Also set the tailwind options to figure out what the input and output paths should be.
This is currently limited to a single input path. Patches are welcome to expand this.
:

    {tailwind_opts, [{input, "./apps/my_project/priv/input.css"},
                     {output, "./apps/my_project/priv/static/assets/output.css"}]}.

In this example I am putting my required input.css file in the priv directory of my application. Most likely, this is what you want to do as well.
It is also recommended to add your output.css file gitignore.

Set the compile provider hook:

    {provider_hooks, [
                     {post, [{compile, {tailwind, compile}}]}
                     ]}.

It is recommended to set it as post, not pre. The logic being, we don't care what our website looks like if the erlang application can't even compile.

Then simply compile your project and your compiled css will be at the output path:

    $ rebar3 compile

## Contributing

Send patches to:

    ~fancycade/public-inbox@lists.sr.ht

If you are new to email based git workflows please refer to this [tutorial](https://git-send-email.io/).

## License

Apache v2