https://github.com/gtramontina/elysia-tailwind
Elysia Tailwind Plugin
https://github.com/gtramontina/elysia-tailwind
Last synced: about 2 months ago
JSON representation
Elysia Tailwind Plugin
- Host: GitHub
- URL: https://github.com/gtramontina/elysia-tailwind
- Owner: gtramontina
- License: mit
- Created: 2023-09-30T12:46:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-17T08:06:51.000Z (about 1 year ago)
- Last Synced: 2024-10-15T04:44:23.014Z (8 months ago)
- Language: TypeScript
- Size: 79.1 KB
- Stars: 36
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Elysia Tailwind
Elysia plugin to compile and serve Tailwind-generated stylesheets.
## Installation
> [!NOTE]
> This package moved to a new scope. If you were using [`elysia-tailwind`](https://www.npmjs.com/package/elysia-tailwind), you should update dependency and your imports to [`@gtramontina.com/elysia-tailwind`](https://www.npmjs.com/package/@gtramontina.com/elysia-tailwind) going forward.```bash
bun add --exact @gtramontina.com/elysia-tailwind
```## Usage
```ts
import { tailwind } from "@gtramontina.com/elysia-tailwind"; // 1. Import
import Elysia from "elysia";new Elysia()
.use(tailwind({ // 2. Use
path: "/public/stylesheet.css", // 2.1 Where to serve the compiled stylesheet;
source: "./source/styles.css", // 2.2 Specify source file path (where your @tailwind directives are);
config: "./tailwind.config.js", // 2.3 Specify config file path or Config object;
options: { // 2.4 Optionally Specify options:
minify: true, // 2.4.1 Minify the output stylesheet (default: NODE_ENV === "production");
map: true, // 2.4.2 Generate source map (default: NODE_ENV !== "production");
autoprefixer: false // 2.4.3 Whether to use autoprefixer;
},
}))
.listen(3000);
```