Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions integrations/postcss.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<Logo name="postcss" class="logo-float-xl"/>

# Integration for [PostCSS](https://postcss.org/)
# [PostCSS](https://postcss.org/) 集成 {#integration-for-postcss}

<PackageInfo name="postcss-windicss" author="antfu" />

> 🧪 Experimental.
> 🧪 实验性的。

> ⚠️ Using this package is **discouraged** as there are some limitations of PostCSS's API. Use our [first-class integrations](https://windicss.org/guide/installation.html) for each dedicated framework/build tool to get **the best develop experience and performance**. This plugin should be your last option to integrate Windi CSS.
> ⚠️ 因为一些 PostCSS API 的限制,我们并**不鼓励**使用这个包。我们为每一个专用工具提供了 [最佳的适配](https://windicss.org/guide/installation.html) 以获得**最佳的开发体验和性能**。这个插件应当作为你集成 Windi CSS 的最后一个选择。

## Install
## 安装 {#install}

Install `postcss-windicss` from NPM
从 NPM 安装 `postcss-windicss`

```bash
npm i -D postcss-windicss
```

Create `postcss.config.js` under your project root
在你的项目根目录下创建 `postcss.config.js`

```js
// postcss.config.js
Expand All @@ -27,14 +27,14 @@ module.exports = {
}
```

Add `@windicss` to your main css entry:
`@windicss` 添加到你的 CSS 入口:

```css
/* main.css */
@windicss;
```

Create `windi.config.js` / `windi.config.ts` under your project root with this configurations
在你的项目根目录下创建 `windi.config.js` / `windi.config.ts` 并写入下面的配置

```js
// windi.config.js
Expand All @@ -48,4 +48,4 @@ export default defineConfig({
})
```

And enjoy!
用得开心~