• star-solid
    
  • star
    
  • 复制
    
  • 新增_面性
    
  • 清除扫帚
    
  • arrow-left-solid
    
  • 删除
    
  • right
    
  • icon_loading
    
  • icon-arrow-left2
    
  • icon-chart-graph
    
  • icon-search
    
  • icon-corner-down-right
    
  • icon_close-small
    
  • TabBar-工作台
    
  • TabBar-审批
    
  • icon-setting-two (1)
    
  • icon-double-up
    
  • icon_to-top
    
  • icon_save
    
  • icon-add-one
    
  • icon-reduce-one
    
  • TabBar-飞书
    
  • TabBar-公告
    
  • icon-setting-two
    
  • icon-double-down
    
  • TabBar-日历
    
  • TabBar-more
    
  • TabBar-通讯录
    
  • hd1-copy
    
  • 8
    
  • 20
    
  • 3
    
  • 2
    
  • 1
    
  • 4
    
  • 10
    
  • 9
    
  • 11
    
  • 12
    
  • 13
    
  • 14
    
  • 17
    
  • 18
    
  • 19
    
  • 21
    
  • 23
    
  • 24
    
  • dt3
    
  • 22
    
  • dt4
    
  • hc7
    
  • dt1
    
  • 20
    
  • hd1
    
  • hc8
    
  • hd3
    
  • hd2
    
  • hd4
    

Unicode 引用


Unicode 是字体在网页端最原始的应用方式,特点是:

  • 支持按字体的方式去动态调整图标大小,颜色等等。
  • 默认情况下不支持多色,直接添加多色图标会自动去色。

注意:新版 iconfont 支持两种方式引用多色图标:SVG symbol 引用方式和彩色字体图标模式。(使用彩色字体图标需要在「编辑项目」中开启「彩色」选项后并重新生成。)

Unicode 使用步骤如下:

第一步:拷贝项目下面生成的 @font-face

@font-face {
  font-family: 'lyf-icon';
  src: url('iconfont.woff2?t=1698054466217') format('woff2'),
       url('iconfont.woff?t=1698054466217') format('woff'),
       url('iconfont.ttf?t=1698054466217') format('truetype');
}

第二步:定义使用 iconfont 的样式

.lyf-icon {
  font-family: "lyf-icon" !important;
  font-size: 16px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

第三步:挑选相应图标并获取字体编码,应用于页面

<span class="lyf-icon">&#x33;</span>

"lyf-icon" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

  • star-solid
    .icon-star-solid
  • star
    .icon-star
  • 复制
    .icon-copy
  • 新增_面性
    .icon-add2
  • 清除扫帚
    .icon-clear
  • arrow-left-solid
    .icon-arrow-left-solid
  • 删除
    .icon-delete
  • right
    .icon-success2
  • icon_loading
    .icon-loading
  • icon-arrow-left2
    .icon-back
  • icon-chart-graph
    .icon-graph
  • icon-search
    .icon-search1
  • icon-corner-down-right
    .icon-corner-down-right
  • icon_close-small
    .icon-close1
  • TabBar-工作台
    .icon-workbench
  • TabBar-审批
    .icon-approve
  • icon-setting-two (1)
    .icon-setting1
  • icon-double-up
    .icon-double-up
  • icon_to-top
    .icon-to-top
  • icon_save
    .icon-save
  • icon-add-one
    .icon-add
  • icon-reduce-one
    .icon-reduce
  • TabBar-飞书
    .icon-feishu
  • TabBar-公告
    .icon-notice
  • icon-setting-two
    .icon-setting2
  • icon-double-down
    .icon-double-down
  • TabBar-日历
    .icon-calendar
  • TabBar-more
    .icon-more
  • TabBar-通讯录
    .icon-address-book
  • hd1-copy
    .icon-close4-copy
  • 8
    .icon-annex
  • 20
    .icon-arrow-right
  • 3
    .icon-list1
  • 2
    .icon-search2
  • 1
    .icon-refresh
  • 4
    .icon-download
  • 10
    .icon-unchecked
  • 9
    .icon-checked
  • 11
    .icon-share
  • 12
    .icon-close2
  • 13
    .icon-list2
  • 14
    .icon-group
  • 17
    .icon-arrow-down
  • 18
    .icon-group2
  • 19
    .icon-list3
  • 21
    .icon-success
  • 23
    .icon-notice2
  • 24
    .icon-info
  • dt3
    .icon-like
  • 22
    .icon-warn
  • dt4
    .icon-like-solid
  • hc7
    .icon-arrow-right-solid
  • dt1
    .icon-message
  • 20
    .icon-close3
  • hd1
    .icon-close4
  • hc8
    .icon-arrow-down-solid
  • hd3
    .icon-arrow-left
  • hd2
    .icon-more2
  • hd4
    .icon-home

font-class 引用


font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。

与 Unicode 使用方式相比,具有如下特点:

  • 相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。
  • 因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。

使用步骤如下:

第一步:引入项目下面生成的 fontclass 代码:

<link rel="stylesheet" href="./iconfont.css">

第二步:挑选相应图标并获取类名,应用于页面:

<span class="lyf-icon icon-xxx"></span>

" lyf-icon" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

  • star-solid
    #icon-star-solid
  • star
    #icon-star
  • 复制
    #icon-copy
  • 新增_面性
    #icon-add2
  • 清除扫帚
    #icon-clear
  • arrow-left-solid
    #icon-arrow-left-solid
  • 删除
    #icon-delete
  • right
    #icon-success2
  • icon_loading
    #icon-loading
  • icon-arrow-left2
    #icon-back
  • icon-chart-graph
    #icon-graph
  • icon-search
    #icon-search1
  • icon-corner-down-right
    #icon-corner-down-right
  • icon_close-small
    #icon-close1
  • TabBar-工作台
    #icon-workbench
  • TabBar-审批
    #icon-approve
  • icon-setting-two (1)
    #icon-setting1
  • icon-double-up
    #icon-double-up
  • icon_to-top
    #icon-to-top
  • icon_save
    #icon-save
  • icon-add-one
    #icon-add
  • icon-reduce-one
    #icon-reduce
  • TabBar-飞书
    #icon-feishu
  • TabBar-公告
    #icon-notice
  • icon-setting-two
    #icon-setting2
  • icon-double-down
    #icon-double-down
  • TabBar-日历
    #icon-calendar
  • TabBar-more
    #icon-more
  • TabBar-通讯录
    #icon-address-book
  • hd1-copy
    #icon-close4-copy
  • 8
    #icon-annex
  • 20
    #icon-arrow-right
  • 3
    #icon-list1
  • 2
    #icon-search2
  • 1
    #icon-refresh
  • 4
    #icon-download
  • 10
    #icon-unchecked
  • 9
    #icon-checked
  • 11
    #icon-share
  • 12
    #icon-close2
  • 13
    #icon-list2
  • 14
    #icon-group
  • 17
    #icon-arrow-down
  • 18
    #icon-group2
  • 19
    #icon-list3
  • 21
    #icon-success
  • 23
    #icon-notice2
  • 24
    #icon-info
  • dt3
    #icon-like
  • 22
    #icon-warn
  • dt4
    #icon-like-solid
  • hc7
    #icon-arrow-right-solid
  • dt1
    #icon-message
  • 20
    #icon-close3
  • hd1
    #icon-close4
  • hc8
    #icon-arrow-down-solid
  • hd3
    #icon-arrow-left
  • hd2
    #icon-more2
  • hd4
    #icon-home

Symbol 引用


这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇文章 这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:

  • 支持多色图标了,不再受单色限制。
  • 通过一些技巧,支持像字体那样,通过 font-size, color 来调整样式。
  • 兼容性较差,支持 IE9+,及现代浏览器。
  • 浏览器渲染 SVG 的性能一般,还不如 png。

使用步骤如下:

第一步:引入项目下面生成的 symbol 代码:

<script src="./iconfont.js"></script>

第二步:加入通用 CSS 代码(引入一次就行):

<style>
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
</style>

第三步:挑选相应图标并获取类名,应用于页面:

<svg class="icon" aria-hidden="true">
  <use xlink:href="#icon-xxx"></use>
</svg>