Skip to content

Commit

Permalink
[Doc] add custom Icon directions (#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
qianzhaoy authored and chenjiahan committed Mar 22, 2018
1 parent 347989b commit 996447c
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/markdown/en-US/icon.md
Expand Up @@ -23,6 +23,36 @@ Icon uses font file in `yzcdn.cn` by default,if you want to use the local font
import 'vant/lib/vant-css/icon-local.css';
```

#### Use custom font
Add more custom icon

[Demo](https://github.com/qianzhaoy/vant--mobile-mall/blob/master/src/assets/scss/iconfont/iconfont.css)

```css
@font-face {
font-family: "iconfont";
src: url('./iconfont.ttf') format('truetype');
}

@font-face {
font-family: "vanIcon";
src: url(https://b.yzcdn.cn/zanui/icon/vant-icon-4c3245.ttf) format('truetype');
}

.van-icon {
position: relative;
font-family: "iconfont", "vanIcon" !important;
font-size: 14px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.van-icon-success:before {
content: "\e626";
}
```

### API

| Attribute | Description | Type | Default | Accepted Values |
Expand Down
28 changes: 28 additions & 0 deletions docs/markdown/zh-CN/icon.md
Expand Up @@ -23,6 +23,34 @@ Icon 组件默认引用 `yzcdn.cn` 域名下的字体文件,如果想要使用
import 'vant/lib/vant-css/icon-local.css';
```

#### 自定义字体
如果我们的Icon数量无法满足你的需求,可以用以下方法,保留原本Icon的情况下,增加更多你想要的Icon

[Demo地址](https://github.com/qianzhaoy/vant--mobile-mall/blob/master/src/assets/scss/iconfont/iconfont.css)
```css
@font-face {
font-family: "iconfont";
src: url('./iconfont.ttf') format('truetype');
}

@font-face {
font-family: "vanIcon";
src: url(https://b.yzcdn.cn/zanui/icon/vant-icon-4c3245.ttf) format('truetype');
}

.van-icon {
position: relative;
font-family: "iconfont", "vanIcon" !important;
font-size: 14px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

.van-icon-success:before {
content: "\e626";
}
```

### API

Expand Down

0 comments on commit 996447c

Please sign in to comment.