# @chapanda/style-preset-tailwind

> chapanda style preset

Latest version **1.4.17-beta.3** (published 2026-06-29) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @chapanda/style-preset-tailwind
pnpm add @chapanda/style-preset-tailwind
yarn add @chapanda/style-preset-tailwind
bun add @chapanda/style-preset-tailwind
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.4.17-beta.3 |
| Published | 2026-06-29 |
| First published | 2024-08-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 16.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | baiwusanyu-c |
| Maintainers | baiwusanyu, black927 |
| Keywords | typescript, javascript, utils, vue, vue3, vite, react, web component |

## Links

- npm: https://www.npmjs.com/package/@chapanda/style-preset-tailwind
- Repository: https://github.com/baiwusanyu-c/chapanda-style-preset
- Issues: https://github.com/baiwusanyu-c/chapanda-style-preset/issues
- npm.io page: https://npm.io/package/@chapanda/style-preset-tailwind

## Dependencies (3)

- [tailwindcss](https://npm.io/package/tailwindcss.md) ^3.4.16
- [@chapanda/style-preset-base](https://npm.io/package/@chapanda/style-preset-base.md) ^1.4.17-beta.3
- [@chapanda/style-preset-utils](https://npm.io/package/@chapanda/style-preset-utils.md) ^1.4.17-beta.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.4.17-beta.3 (latest) — 2026-06-29
- 1.4.17-beta.1 — 2026-06-29
- 1.4.16 — 2025-08-07
- 1.4.15 — 2025-08-07
- 1.4.14 — 2025-07-21
- 1.4.13 — 2025-07-09
- 1.4.12 — 2025-07-09
- 1.4.11 — 2025-06-26
- 1.4.10 — 2025-06-24
- 1.4.9 — 2025-01-15
- 1.4.8 — 2025-01-15
- 1.4.7 — 2025-01-15
- 1.4.6 — 2024-12-13
- 1.4.6-beta.1 — 2024-12-13
- 1.4.4 — 2024-12-12
- … 21 more at https://npm.io/package/@chapanda/style-preset-tailwind/versions

## README

# @chapanda/style-preset-tailwind

基于中心规范基础结合 `tailwindcss` 的样式预设，它实现了和 `@chapanda/style-preset-base`几乎一样的样式预设.

## 使用
在 `tailwind.config.ts` 配置文件中使用 `chaPandaTailwindConfig` 方法包裹导出的配置对象. 

```typescript jsx
import type { Config } from 'tailwindcss'
import { chaPandaTailwindConfig } from '@chapanda/style-preset-tailwind'
export default chaPandaTailwindConfig({
  content: [
    "index.html",
    "src/**/*.{js,ts,jsx,tsx}",
  ],
  presets: [
    // 省略配置
  ],
  darkMode: 'media', // or 'class'
  theme: [
    // 省略配置
  ],
  plugins: [
    // 省略配置
  ],
}) satisfies Config
```


## API

### chaPandaTailwindConfig

`@chapanda/style-preset-tailwind` 使用了 `tailwindcss` 的 `theme` 中 `colors` 和 `plugin` 中的 `shortcut` 选项,
特别是如果你需要扩展 `shortcut` 时，不要把他放在 `plugin` 选项里，而是需要把他作为第二个参数传递给 `chaPandaTailwindConfig`

```typescript jsx
declare function chaPandaPresetTailWindShortcut(customShortcut?: Record<string, string>): (context: PluginAPI) => void;
declare const chaPandaTailwindConfig: (
  // tailwindcss 的配置对象
  userConfig: Config, 
  // shortcut 插件选项
  options?: ChaPandaTailwindOptions
) => tailwindcss_types_config.Config;
```


## 参考
关于全局样式（布局对齐、字体、颜色变量等）请阅读 `@chapanda/style-preset-base` 文档

---
_Source: https://npm.io/package/@chapanda/style-preset-tailwind · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
