Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:youzan/vant into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
niunai committed Mar 22, 2018
2 parents d230059 + a0bed46 commit 84019a2
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/markdown/en-US/icon.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,27 @@ 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';
```

#### Add custom iconfont

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

.van-icon {
font-family: 'vant-icon', 'custom-iconfont' !important;
}

.van-icon-extra:before {
content: '\e626';
}
```

```html
<van-icon name="extra" />
```

### API

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

#### 自定义图标
如果需要在现有 Icon 的基础上使用更多图标,可以引入你需要的 iconfont 对应的 ttf 文件和样式,之后就可以在 Icon 组件中直接使用

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

.van-icon {
font-family: 'vant-icon', 'custom-iconfont' !important;
}

.van-icon-extra:before {
content: '\e626';
}
```

```html
<van-icon name="extra" />
```

### API

Expand Down

0 comments on commit 84019a2

Please sign in to comment.