Skip to content

Commit c2232a4

Browse files
HerbertHeQC-L
andauthored
docs(cn): features/value-auto-infer translation (#28)
* docs(cn): features/value-auto-infer translation * docs(cn): update features/value-auto-infer * Update features/value-auto-infer.md Co-authored-by: QiChang Li <github@liqichang.com> Co-authored-by: QiChang Li <github@liqichang.com>
1 parent 59c78be commit c2232a4

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

features/value-auto-infer.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Value Auto-infer
1+
# 自动值推导 {#value-auto-infer}
22

3-
Since Windi CSS will only generate the CSS utilities you use, it enables the possibility to use arbitrary value in your classes and generate coresponding styles based on the appropriate semantics.
3+
Windi CSS 只会生成你使用的 CSS 工具类,它允许你在样式类中编写任意值,同时会根据适当的语义生成相应的样式。
44

55
```html
6-
<!-- sizes and positions -->
6+
<!-- 尺寸和定位 -->
77
<div class="p-5px mt-[0.3px]"></div>
88

9-
<!-- colors -->
9+
<!-- 颜色 -->
1010
<button class="bg-hex-b2a8bb"></button>
1111
<button class="bg-[#b2a8bb]"></button>
1212
<button class="bg-[hsl(211.7,81.9%,69.6%)]"></button>
@@ -15,29 +15,29 @@ Since Windi CSS will only generate the CSS utilities you use, it enables the pos
1515
<div class="grid-cols-[auto,1fr,30px]"></div>
1616
```
1717

18-
This is useful when you want to opt-out your design system and have some fine-grain controls over some specific components. Both direct `p-5px` and explicitly escaping `p-[5px]` are supported.
18+
当你想有意忽略你的设计系统,并且对特定的组件有一定的粒度控制时,这是非常有用的。直接的 `p-5px` 和 显示转义的 `p-[5px]` 都是被支持的。
1919

20-
We also provided [an visual analyser](/features/analyzer) to give you an overview of all the utilities usages in your project and spot unwanted value escaping of your design system with ease.
20+
我们提供了一个 [可视化分析器](/features/analyzer),可以让你对你项目中所有工具类的使用情况有一个概览,轻松标记出你设计系统中不符合预期的值转义。
2121

22-
## Numbers
22+
## 数字 {#numbers}
2323

2424
```less
2525
p-{float} -> padding: {float/4}rem;
2626
```
2727

2828
<InlinePlayground :input="'p-2.5\np-3.2'" :showCSS="true" :showPreview="false"/>
2929

30-
## Sizes
30+
## 尺寸 {#sizes}
3131

3232
```less
33-
// {size} should be end with rem|em|px|vh|vw|ch|ex
33+
// {size} 应当以 rem|em|px|vh|vw|ch|ex 结尾
3434
p-{size} -> padding: {size};
3535
```
3636

3737
<InlinePlayground :input="'p-3px\np-4rem'" :showCSS="true" :showPreview="false"/>
3838

3939

40-
## Fractions
40+
## 分数 {#fractions}
4141

4242
```less
4343
w-{fraction} -> width: {fraction -> precent};
@@ -46,32 +46,32 @@ w-{fraction} -> width: {fraction -> precent};
4646
<InlinePlayground :input="'w-9/12'" :showCSS="true" :showPreview="false"/>
4747

4848

49-
## Colors
49+
## 颜色 {#colors}
5050

5151
```css
5252
text-{color} -> color: rgba(...);
5353

5454
border-hex-{hex} -> border-color: rgba(...);
5555
```
5656

57-
<InlinePlayground
58-
:input="'text-cyan-400\nborder-hex-6dd1c7'"
59-
:showCSS="true"
57+
<InlinePlayground
58+
:input="'text-cyan-400\nborder-hex-6dd1c7'"
59+
:showCSS="true"
6060
:showPreview="false"
6161
fixed="border border-2 px-4 py-2 rounded"
6262
/>
6363

64-
## Variables
64+
## 变量 {#variables}
6565

66-
You can even pass variable names, which is very useful in combination with css variables.
66+
你甚至可以传递变量名称,在与 css 变量结合时非常有用。
6767

6868
```css
6969
bg-${variableName}
7070
```
7171

72-
<InlinePlayground
73-
:input="'bg-$test-variable'"
74-
:showCSS="true"
72+
<InlinePlayground
73+
:input="'bg-$test-variable'"
74+
:showCSS="true"
7575
:showPreview="false"
7676
/>
7777

@@ -81,8 +81,8 @@ bg-${variableName}
8181
grid-cols-[auto,1fr,30px]
8282
```
8383

84-
<InlinePlayground
85-
:input="'grid-cols-[auto,1fr,30px]'"
86-
:showCSS="true"
84+
<InlinePlayground
85+
:input="'grid-cols-[auto,1fr,30px]'"
86+
:showCSS="true"
8787
:showPreview="false"
8888
/>

0 commit comments

Comments
 (0)