update documentation of icon

This commit is contained in:
afc163 2017-03-19 14:12:58 +08:00
parent 81c1a77686
commit 9a72f94027
3 changed files with 17 additions and 23 deletions

View File

@ -5,15 +5,18 @@ title: Icon
toc: false
---
Meaningful vector graphics.
Semantic vector graphics.
## Icons naming convention
We provide semantic name for every icon, and naming rules are as follows:
- Scanning line icon has the similar name with its solid onebut it's distinguished by `-o`, for example, `question-circle`(a full circle) and `question-circle-o`(an empty circle);
- Scanning line icon has the similar name with its solid onebut it's distinguished by `-o`, for example, `question-circle` (a full circle) and `question-circle-o` (an empty circle);
- Naming sequence`[name]-[shape?]-[outline?]-[direction?]`.
- Naming sequence`[icon's name]-[shape, optional]-[Scanning line or not]-[direction, optional]`.
> `?` means is optional.
See more design detail at [here](/docs/spec/icon).
## How To Use
@ -23,15 +26,9 @@ Use tag <Icon /> to create an icon and set its type in the type prop, for exampl
<Icon type="link" />
```
Finally, it will be rendered as follow:
## Local deployment
```html
<i class="anticon anticon-${type}"></i>
```
## Local deployment of icons font
By default, icon components uses [iconfont.cn](http://iconfont.cn), publicly available repository of a huge set of icons. In case you need to use a locally deployed version of the icon font, you can refer to [this example](https://github.com/ant-design/antd-init/tree/master/examples/local-iconfont)。
By default, icons are deployed at [iconfont.cn](http://iconfont.cn), publicly available repository of a huge set of icons. In case you need to use a locally deployed version of the icon font, you can refer to [this example](https://github.com/ant-design/antd-init/tree/master/examples/local-iconfont)。
## List of icons
@ -65,7 +62,7 @@ import IconSet from 'site/theme/template/IconSet';
ReactDOM.render(<IconSet className="icons" catigory="logo" />, mountNode);
```
## Props
## API
| Property | Description | Type | Default |
|----------|------------------|------- |---------|

View File

@ -12,9 +12,12 @@ toc: false
我们为每个图标赋予了语义化的命名,命名规则如下:
- 实心和描线图标保持同名,用 `-o` 来区分,比如 `question-circle`(实心) 和 `question-circle-o`(描线)
- 实心和描线图标保持同名,用 `-o` 来区分,比如 `question-circle`(实心) 和 `question-circle-o`(描线);
- 命名顺序:`[图标名]-[形状?]-[描线?]-[方向?]`。
- 命名顺序:`[icon名]-[形状可选]-[描线与否]-[方向可选]`。
> `?` 为可选。
完整的图标设计规范请访问 [图标规范](/docs/spec/icon)。
## 如何使用
@ -24,15 +27,9 @@ toc: false
<Icon type="link" />
```
最终会渲染为:
```html
<i class="anticon anticon-${type}"></i>
```
## 本地部署
图标组件使用 [iconfont.cn](http://iconfont.cn),默认公网可访问。如需本地部署,可参考 [示例](https://github.com/ant-design/antd-init/tree/master/examples/local-iconfont)。
图标默认托管在 [iconfont.cn](http://iconfont.cn),默认公网可访问。如需本地部署,可参考 [示例](https://github.com/ant-design/antd-init/tree/master/examples/local-iconfont)。
## 图标列表
@ -66,7 +63,7 @@ import IconSet from 'site/theme/template/IconSet';
ReactDOM.render(<IconSet className="icons" catigory="logo" />, mountNode);
```
## Props
## API
| 参数 | 说明 | 类型 | 默认值 |
|----------|------------------|----------|--------|

View File

@ -87,7 +87,7 @@ Ant Design 的图标设计中,外轮廓线统一半径为 72px 的圆角ico
<img class="preview-img no-padding" align="right" src="https://zos.alipayobjects.com/rmsportal/uYhuxxiWZlgVwdmfqUli.png" description="注:表格中 @Black = #000000、@White = #FFFFFF、@Blue-6 = #108EE9">
icon 的颜色需要与搭配文案的色值保持一致(表示状态的除外)。
图标的颜色需要与搭配文案的色值保持一致(表示状态的除外)。
---