Skip to content

LLBlumire/tailwindcss-native-rust-macro

Repository files navigation

The include_tailwind! macro expects to be passed a set of arguments that will govern how it behaves. The expected format is as follows:

include_tailwind! {
    config: "path/to/tailwind.config.js",
    input: "path/to/tailwind.input.js",
    tailwindcss_bin: "/path/to/tailwindcss/bin/tailwindcss"
}

If a relative path is given, it will be taken relative to the CARGO_MANIFEST_DIR.

The macro will then compile to an inline string representing the output from tailwindcss. This can then be embeded in and returned by (with necessary CSS headers) your web server framework of choice.

If any of the arguments are not present, they will be read from a corresponding environment variable:

  • TAILWINDCSS_CONFIG
  • TAILWINDCSS_INPUT
  • TAILWINDCSS_BIN

If you would like to override the environment variable being read from, you may do that with the _env parameters.

include_tailwind! {
    config_env: "MY_TAILWINDCSS_CONFIG_ENV_VAR",
    input_env: "MY_TAILWINDCSS_INPUT_ENV_VAR",
    tailwindcss_bin: "MY_TAILWINDCSS_BIN_ENV_VAR"
}

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages