Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(cn): guide/migration translation #18

Merged
merged 3 commits into from
May 27, 2021
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
24 changes: 12 additions & 12 deletions guide/migration.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[auto]: /features/value-auto-infer
[design]: /posts/story

# Migrate from Tailwind CSS
# Tailwind CSS 迁移 {#migrate-from-tailwind-css}

### `package.json`
### `package.json` {#package-json}

Some of your dependencies are no longer required, you can remove them if they were only needed for Tailwind CSS.
一些依赖不再是必须的。如果它们只是 Tailwind CSS 的依赖,你可以安全地移除它们。

```diff
- "tailwindcss": "*",
Expand All @@ -14,30 +14,30 @@ Some of your dependencies are no longer required, you can remove them if they we
+ "windicss": "*"
```

### Base Styles
### 基础样式 {#base-styles}

You can now remove the Tailwind CSS imports from your css entry.
你现在可以从你的 CSS 中移除 Tailwind CSS 的入口。

```diff
- @import 'tailwindcss/base';
- @import 'tailwindcss/components';
- @import 'tailwindcss/utilities';
```

(Optional) Based on the integrations tools you are using, you might need to import the `virtual:windi.css` entry explicitly. Please check the docs of the tools for more details.
(可选)基于你所使用的集成工具,你可能需要在入口显式引入 `virtual:windi.css`。请查看工具的文档来获得更多的细节。

```js
// main.js
import 'virtual:windi.css'
```

### Configurations
### 配置文件 {#configurations}

Since all variants are [automatically enabled][auto], `variant` and `purge` fields are no longer needed.
所有的可变修饰 (variants) 都是 [默认启用][auto] 的,不再需要对 `variant` `purge` 进行配置。

`colors` and `plugins` need to be imported from `windicss` instead.
`colors` `plugins` 需要从 `windicss` 引入来替代。

We are compatible with both `windi.config.js` or `tailwind.config.js`
我们同时兼容 `windi.config.js` `tailwind.config.js`

```diff
-const colors = require('tailwindcss/colors')
Expand Down Expand Up @@ -75,9 +75,9 @@ export default {
}
```

### Cleanup (optional)
### 清理(可选) {#cleanup-optional}

The following files can be removed if you don't use their other features.
如果你不使用下面配置文件的其他特性,你可以删掉它。

```diff
- postcss.config.js
Expand Down