Simply make a post request with your all classes (space delimited) and optional options to configure Tailwind.
The return will be a text body with the generated Tailwind CSS, or JSON error response if the request is malformed.
{
"text": "text-4xl text-slate-700",
"options": {
"preflight": false,
"prefix": "tw-",
"theme": {
"fontFamily": {
"sans": ["Arial", "sans-serif"],
"serif": ["Times", "serif"]
}
}
}
}
You can use the following plugins by passing a plugins array like so:
{
"text": "text-4xl text-slate-700",
"plugins": [
"tailwind-forms",
"typography"
],
"options": {
"preflight": true,
"theme": {
"fontFamily": {
"sans": ["Arial", "sans-serif"],
"serif": ["Times", "serif"]
}
}
}
}
Note that preflight must not be disabled for use with some plugins such as tailwind-forms
.
The options are the same JSON-equivalent object you would find in the official Tailwind documentation. Of course, some of it won’t apply, such as content
.