Crates.io | tailwindcss-native-rust-macro |
lib.rs | tailwindcss-native-rust-macro |
version | 0.1.0 |
source | src |
created_at | 2024-04-22 00:46:28.532347 |
updated_at | 2024-04-22 00:46:28.532347 |
description | Generate tailwind output as a literal string at compile time. |
homepage | |
repository | https://github.com/llblumire/tailwindcss-native-rust-macro |
max_upload_size | |
id | 1215744 |
size | 28,883 |
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:
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"
}