Skip to content

Commit

Permalink
docs(cn): guide/migration translation (#18)
Browse files Browse the repository at this point in the history
* docs(cn): guide/migration translation

* docs(cn): update guide/migration

* Apply suggestions from code review

Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
  • Loading branch information
HerbertHe and antfu committed May 27, 2021
1 parent f0e412f commit 4e69135
Showing 1 changed file with 12 additions and 12 deletions.
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

0 comments on commit 4e69135

Please sign in to comment.