# preact-cli-tailwind-purgecss

> Get started with Tailwind and PurgeCSS in your Preact project

Latest version **1.0.0** (published 2020-10-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install preact-cli-tailwind-purgecss
pnpm add preact-cli-tailwind-purgecss
yarn add preact-cli-tailwind-purgecss
bun add preact-cli-tailwind-purgecss
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-10-07 |
| First published | 2020-10-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | https://github.com/jpbow |
| Maintainers | jbow |
| Keywords | purgecss, tailwind, css, preact, cli |

## Links

- npm: https://www.npmjs.com/package/preact-cli-tailwind-purgecss
- Repository: https://github.com/jpbow/preact-cli-tailwind-purgecss
- Homepage: https://github.com/jpbow/preact-cli-tailwind-purgecss#readme
- Issues: https://github.com/jpbow/preact-cli-tailwind-purgecss/issues
- npm.io page: https://npm.io/package/preact-cli-tailwind-purgecss

## Dependencies (1)

- [@fullhuman/postcss-purgecss](https://npm.io/package/@fullhuman/postcss-purgecss.md) 3.0.0

## Alternatives

- [@sveltejs/kit](https://npm.io/package/@sveltejs/kit.md) — 2.2M weekly downloads
- [@atlaskit/theme](https://npm.io/package/@atlaskit/theme.md) — 402.0K weekly downloads
- [@tangle-network/brand](https://npm.io/package/@tangle-network/brand.md) — 10.0K weekly downloads
- [seneca](https://npm.io/package/seneca.md) — 7.4K weekly downloads
- [@bsb/base](https://npm.io/package/@bsb/base.md) — 7.2K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2020-10-07
- 0.1.0 — 2020-10-07

## README

# preact-cli-tailwind-purgecss

Adds Tailwind and a typical PurgeCSS config to your Preact CLI project.

Unused styles are purged during production builds.

## Getting Started

Install the plugin and TailwindCSS:

```shell
yarn add preact-cli-tailwind-purgecss tailwindcss --dev
```

Include the plugin in your project by creating a `preact.config.js`

```javascript
const preactCliTailwindPurgeCSS = require("preact-cli-tailwind-purgecss");

export default function (config, env, helpers) {
  preactCliTailwindPurgeCSS(config, env, helpers);
}
```

Create a `tailwind.config.js` file.

```javascript
module.exports = {
  future: {
    removeDeprecatedGapUtilities: true,
    purgeLayersByDefault: true,
  },
  purge: [],
  theme: {
    extend: {},
  },
  variants: {},
  plugins: [],
};
```

Create a folder for styles, and a CSS file in `src/styles` with the following Tailwind imports. (Or SASS/SCSS, install `sass-loader` & `node-sass` for this `yarn add -D sass-loader node-sass`).

```css
@tailwind base;

@tailwind components;

@tailwind utilities;
```

Then import that CSS or SASS file into your app's main `index.js` file, e.g. `import "./styles/index.css";`

## Custom PurgeCSS Configuration

Pass in an object with any required config.

```javascript
const preactCliTailwindPurgeCSS = require("preact-cli-tailwind-purgecss");

export default function (config, env, helpers) {
  preactCliTailwindPurgeCSS(config, env, helpers, {
    content: ["./src/**/*.mdx"],
  });
}
```

## License

MIT

---
_Source: https://npm.io/package/preact-cli-tailwind-purgecss · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
