• bluetooth off
    
  • bluetoothon
    
  • camera
    
  • course
    
  • bluetooth_link
    
  • addto
    
  • child
    
  • audio
    
  • delete
    
  • DND_mode
    
  • edit
    
  • child2
    
  • settings
    
  • bluray
    
  • cancel
    
  • down
    
  • brightness
    
  • musiclist
    
  • home
    
  • favoriteslist
    
  • loop
    
  • nextsong
    
  • bottom
    
  • guarantee
    
  • agreement
    
  • prevent
    
  • privacy2
    
  • play
    
  • brightness2
    
  • privac_open
    
  • conversation
    
  • information
    
  • answer
    
  • face
    
  • protect
    
  • close
    
  • nosignal
    
  • refuse
    
  • selection
    
  • previous
    
  • Privacy
    
  • increase
    
  • music
    
  • save
    
  • singlecycle
    
  • prompt
    
  • Incoming_call
    
  • layered
    
  • collection
    
  • soundsize
    
  • upward
    
  • vision
    
  • top
    
  • history
    
  • shopping
    
  • turnvoice
    
  • locking
    
  • restore
    
  • night
    
  • safety
    
  • phone
    
  • relationship
    
  • next
    
  • timeout
    
  • video1
    
  • refresh
    
  • visible
    
  • telephone
    
  • th_internet
    
  • callout
    
  • withdraw
    
  • call
    
  • video2
    
  • hangup
    
  • mute
    
  • eye_protection
    
  • distance
    
  • voice
    
  • nickname
    
  • payment
    
  • privacy_closed
    
  • movie
    
  • wifi
    
  • random
    
  • problem
    
  • address
    
  • check more
    
  • book resource
    
  • back
    
  • check more
    
  • address list
    
  • address
    
  • cancel white
    
  • cancel
    
  • close
    
  • clock
    
  • genie calling
    
  • entertainment mark
    
  • add meteo
    
  • evitare payment
    
  • genie clock
    
  • highway first
    
  • faimly album
    
  • genie SEC
    
  • info
    
  • genie community
    
  • house care
    
  • marks
    
  • info personal
    
  • calling robort
    
  • master ctrl
    
  • message white
    
  • message
    
  • light ctrl
    
  • mirror light ctrl
    
  • kids lock
    
  • evitare highway
    
  • group ctrl
    
  • mute mode
    
  • search
    
  • huoyan
    
  • payment life
    
  • step back
    
  • skin test
    
  • scan QR
    
  • instruction
    
  • respond
    
  • mask clock
    
  • MTR
    
  • suggestion
    
  • queen mirror
    
  • phone bill
    
  • voice memo
    
  • scan read
    
  • schedule
    
  • tips money
    
  • voice shopping
    
  • to go
    
  • voiceprint
    
  • xiami music
    
  • sleep mode
    
  • Q&A
    
  • volume
    
  • cart
    
  • check surface
    
  • check
    
  • birthday
    
  • device off
    
  • custom
    
  • diffuser stop area
    
  • diffuser stop
    
  • diffuser play
    
  • connect device
    
  • cook
    
  • diffuser play area
    
  • device on
    
  • dinner
    
  • done work
    
  • dislike
    
  • get up
    
  • disconnect device
    
  • get out
    
  • guests
    
  • feeding
    
  • like
    
  • mark
    
  • good night
    
  • meeting
    
  • house cleaning
    
  • go home
    
  • hot
    
  • radio button unselect
    
  • menu
    
  • radio button select
    
  • record
    
  • meeting over
    
  • microphone off
    
  • share
    
  • singing
    
  • series finale
    
  • put baby to bed
    
  • washing room
    
  • wake up baby
    
  • watch series
    
  • take a break
    
  • setting
    

Unicode 引用


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

  • 兼容性最好,支持 IE6+,及所有现代浏览器。
  • 支持按字体的方式去动态调整图标大小,颜色等等。
  • 但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。

注意:新版 iconfont 支持多色图标,这些多色图标在 Unicode 模式下将不能使用,如果有需求建议使用symbol 的引用方式

Unicode 使用步骤如下:

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

@font-face {
  font-family: 'iconfont';
  src: url('iconfont.eot');
  src: url('iconfont.eot?#iefix') format('embedded-opentype'),
      url('iconfont.woff2') format('woff2'),
      url('iconfont.woff') format('woff'),
      url('iconfont.ttf') format('truetype'),
      url('iconfont.svg#iconfont') format('svg');
}

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

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

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

<span class="iconfont">&#x33;</span>

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

  • bluetooth off
    .icon-bluetoothoff
  • bluetoothon
    .icon-bluetoothon
  • camera
    .icon-camera
  • course
    .icon-course
  • bluetooth_link
    .icon-bluetooth_link
  • addto
    .icon-addto
  • child
    .icon-child
  • audio
    .icon-audio
  • delete
    .icon-delete
  • DND_mode
    .icon-DND_mode
  • edit
    .icon-edit
  • child2
    .icon-child1
  • settings
    .icon-settings
  • bluray
    .icon-bluray
  • cancel
    .icon-cancel
  • down
    .icon-down
  • brightness
    .icon-brightness
  • musiclist
    .icon-musiclist
  • home
    .icon-home
  • favoriteslist
    .icon-favoriteslist
  • loop
    .icon-loop
  • nextsong
    .icon-nextsong
  • bottom
    .icon-bottom
  • guarantee
    .icon-guarantee
  • agreement
    .icon-agreement
  • prevent
    .icon-prevent
  • privacy2
    .icon-privacy
  • play
    .icon-play
  • brightness2
    .icon-brightness1
  • privac_open
    .icon-privac_open
  • conversation
    .icon-conversation
  • information
    .icon-information
  • answer
    .icon-answer
  • face
    .icon-face
  • protect
    .icon-protect
  • close
    .icon-close
  • nosignal
    .icon-nosignal
  • refuse
    .icon-refuse
  • selection
    .icon-selection
  • previous
    .icon-previous
  • Privacy
    .icon-Privacy
  • increase
    .icon-increase
  • music
    .icon-music
  • save
    .icon-save
  • singlecycle
    .icon-singlecycle
  • prompt
    .icon-prompt
  • Incoming_call
    .icon-Incoming_call
  • layered
    .icon-layered
  • collection
    .icon-collection
  • soundsize
    .icon-soundsize
  • upward
    .icon-upward
  • vision
    .icon-vision
  • top
    .icon-top
  • history
    .icon-history
  • shopping
    .icon-shopping
  • turnvoice
    .icon-turnvoice
  • locking
    .icon-locking
  • restore
    .icon-restore
  • night
    .icon-night
  • safety
    .icon-safety
  • phone
    .icon-phone
  • relationship
    .icon-relationship
  • next
    .icon-next
  • timeout
    .icon-timeout
  • video1
    .icon-video
  • refresh
    .icon-refresh
  • visible
    .icon-visible
  • telephone
    .icon-telephone
  • th_internet
    .icon-th_internet
  • callout
    .icon-callout
  • withdraw
    .icon-withdraw
  • call
    .icon-call
  • video2
    .icon-video1
  • hangup
    .icon-hangup
  • mute
    .icon-mute
  • eye_protection
    .icon-eye_protection
  • distance
    .icon-distance
  • voice
    .icon-voice
  • nickname
    .icon-nickname
  • payment
    .icon-payment
  • privacy_closed
    .icon-privacy_closed
  • movie
    .icon-movie
  • wifi
    .icon-wifi
  • random
    .icon-random
  • problem
    .icon-problem
  • address
    .icon-address
  • check more
    .icon-checkmore
  • book resource
    .icon-bookresource
  • back
    .icon-back
  • check more
    .icon-checkmore1
  • address list
    .icon-addresslist
  • address
    .icon-address1
  • cancel white
    .icon-cancelwhite
  • cancel
    .icon-cancel1
  • close
    .icon-close1
  • clock
    .icon-clock
  • genie calling
    .icon-geniecalling
  • entertainment mark
    .icon-entertainmentmark
  • add meteo
    .icon-addmeteo
  • evitare payment
    .icon-evitarepayment
  • genie clock
    .icon-genieclock
  • highway first
    .icon-highwayfirst
  • faimly album
    .icon-faimlyalbum
  • genie SEC
    .icon-genieSEC
  • info
    .icon-info
  • genie community
    .icon-geniecommunity
  • house care
    .icon-housecare
  • marks
    .icon-marks
  • info personal
    .icon-infopersonal
  • calling robort
    .icon-callingrobort
  • master ctrl
    .icon-masterctrl
  • message white
    .icon-messagewhite
  • message
    .icon-message
  • light ctrl
    .icon-lightctrl
  • mirror light ctrl
    .icon-mirrorlightctrl
  • kids lock
    .icon-kidslock
  • evitare highway
    .icon-evitarehighway
  • group ctrl
    .icon-groupctrl
  • mute mode
    .icon-mutemode
  • search
    .icon-search
  • huoyan
    .icon-huoyan
  • payment life
    .icon-paymentlife
  • step back
    .icon-stepback
  • skin test
    .icon-skintest
  • scan QR
    .icon-scanQR
  • instruction
    .icon-instruction
  • respond
    .icon-respond
  • mask clock
    .icon-maskclock
  • MTR
    .icon-MTR
  • suggestion
    .icon-suggestion
  • queen mirror
    .icon-queenmirror
  • phone bill
    .icon-phonebill
  • voice memo
    .icon-voicememo
  • scan read
    .icon-scanread
  • schedule
    .icon-schedule
  • tips money
    .icon-tipsmoney
  • voice shopping
    .icon-voiceshopping
  • to go
    .icon-togo
  • voiceprint
    .icon-voiceprint
  • xiami music
    .icon-xiamimusic
  • sleep mode
    .icon-sleepmode
  • Q&A
    .icon-QA
  • volume
    .icon-volume
  • cart
    .icon-cart
  • check surface
    .icon-checksurface
  • check
    .icon-check
  • birthday
    .icon-birthday
  • device off
    .icon-deviceoff
  • custom
    .icon-custom
  • diffuser stop area
    .icon-diffuserstoparea
  • diffuser stop
    .icon-diffuserstop
  • diffuser play
    .icon-diffuserplay
  • connect device
    .icon-connectdevice
  • cook
    .icon-cook
  • diffuser play area
    .icon-diffuserplayarea
  • device on
    .icon-deviceon
  • dinner
    .icon-dinner
  • done work
    .icon-donework
  • dislike
    .icon-dislike
  • get up
    .icon-getup
  • disconnect device
    .icon-disconnectdevice
  • get out
    .icon-getout
  • guests
    .icon-guests
  • feeding
    .icon-feeding
  • like
    .icon-like
  • mark
    .icon-mark
  • good night
    .icon-goodnight
  • meeting
    .icon-meeting
  • house cleaning
    .icon-housecleaning
  • go home
    .icon-gohome
  • hot
    .icon-hot
  • radio button unselect
    .icon-radiobuttonunselect
  • menu
    .icon-menu
  • radio button select
    .icon-radiobuttonselect
  • record
    .icon-record
  • meeting over
    .icon-meetingover
  • microphone off
    .icon-microphoneoff
  • share
    .icon-share
  • singing
    .icon-singing
  • series finale
    .icon-seriesfinale
  • put baby to bed
    .icon-putbabytobed
  • washing room
    .icon-washingroom
  • wake up baby
    .icon-wakeupbaby
  • watch series
    .icon-watchseries
  • take a break
    .icon-takeabreak
  • setting
    .icon-setting

font-class 引用


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

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

  • 兼容性良好,支持 IE8+,及所有现代浏览器。
  • 相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。
  • 因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。
  • 不过因为本质上还是使用的字体,所以多色图标还是不支持的。

使用步骤如下:

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

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

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

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

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

  • bluetooth off
    #icon-bluetoothoff
  • bluetoothon
    #icon-bluetoothon
  • camera
    #icon-camera
  • course
    #icon-course
  • bluetooth_link
    #icon-bluetooth_link
  • addto
    #icon-addto
  • child
    #icon-child
  • audio
    #icon-audio
  • delete
    #icon-delete
  • DND_mode
    #icon-DND_mode
  • edit
    #icon-edit
  • child2
    #icon-child1
  • settings
    #icon-settings
  • bluray
    #icon-bluray
  • cancel
    #icon-cancel
  • down
    #icon-down
  • brightness
    #icon-brightness
  • musiclist
    #icon-musiclist
  • home
    #icon-home
  • favoriteslist
    #icon-favoriteslist
  • loop
    #icon-loop
  • nextsong
    #icon-nextsong
  • bottom
    #icon-bottom
  • guarantee
    #icon-guarantee
  • agreement
    #icon-agreement
  • prevent
    #icon-prevent
  • privacy2
    #icon-privacy
  • play
    #icon-play
  • brightness2
    #icon-brightness1
  • privac_open
    #icon-privac_open
  • conversation
    #icon-conversation
  • information
    #icon-information
  • answer
    #icon-answer
  • face
    #icon-face
  • protect
    #icon-protect
  • close
    #icon-close
  • nosignal
    #icon-nosignal
  • refuse
    #icon-refuse
  • selection
    #icon-selection
  • previous
    #icon-previous
  • Privacy
    #icon-Privacy
  • increase
    #icon-increase
  • music
    #icon-music
  • save
    #icon-save
  • singlecycle
    #icon-singlecycle
  • prompt
    #icon-prompt
  • Incoming_call
    #icon-Incoming_call
  • layered
    #icon-layered
  • collection
    #icon-collection
  • soundsize
    #icon-soundsize
  • upward
    #icon-upward
  • vision
    #icon-vision
  • top
    #icon-top
  • history
    #icon-history
  • shopping
    #icon-shopping
  • turnvoice
    #icon-turnvoice
  • locking
    #icon-locking
  • restore
    #icon-restore
  • night
    #icon-night
  • safety
    #icon-safety
  • phone
    #icon-phone
  • relationship
    #icon-relationship
  • next
    #icon-next
  • timeout
    #icon-timeout
  • video1
    #icon-video
  • refresh
    #icon-refresh
  • visible
    #icon-visible
  • telephone
    #icon-telephone
  • th_internet
    #icon-th_internet
  • callout
    #icon-callout
  • withdraw
    #icon-withdraw
  • call
    #icon-call
  • video2
    #icon-video1
  • hangup
    #icon-hangup
  • mute
    #icon-mute
  • eye_protection
    #icon-eye_protection
  • distance
    #icon-distance
  • voice
    #icon-voice
  • nickname
    #icon-nickname
  • payment
    #icon-payment
  • privacy_closed
    #icon-privacy_closed
  • movie
    #icon-movie
  • wifi
    #icon-wifi
  • random
    #icon-random
  • problem
    #icon-problem
  • address
    #icon-address
  • check more
    #icon-checkmore
  • book resource
    #icon-bookresource
  • back
    #icon-back
  • check more
    #icon-checkmore1
  • address list
    #icon-addresslist
  • address
    #icon-address1
  • cancel white
    #icon-cancelwhite
  • cancel
    #icon-cancel1
  • close
    #icon-close1
  • clock
    #icon-clock
  • genie calling
    #icon-geniecalling
  • entertainment mark
    #icon-entertainmentmark
  • add meteo
    #icon-addmeteo
  • evitare payment
    #icon-evitarepayment
  • genie clock
    #icon-genieclock
  • highway first
    #icon-highwayfirst
  • faimly album
    #icon-faimlyalbum
  • genie SEC
    #icon-genieSEC
  • info
    #icon-info
  • genie community
    #icon-geniecommunity
  • house care
    #icon-housecare
  • marks
    #icon-marks
  • info personal
    #icon-infopersonal
  • calling robort
    #icon-callingrobort
  • master ctrl
    #icon-masterctrl
  • message white
    #icon-messagewhite
  • message
    #icon-message
  • light ctrl
    #icon-lightctrl
  • mirror light ctrl
    #icon-mirrorlightctrl
  • kids lock
    #icon-kidslock
  • evitare highway
    #icon-evitarehighway
  • group ctrl
    #icon-groupctrl
  • mute mode
    #icon-mutemode
  • search
    #icon-search
  • huoyan
    #icon-huoyan
  • payment life
    #icon-paymentlife
  • step back
    #icon-stepback
  • skin test
    #icon-skintest
  • scan QR
    #icon-scanQR
  • instruction
    #icon-instruction
  • respond
    #icon-respond
  • mask clock
    #icon-maskclock
  • MTR
    #icon-MTR
  • suggestion
    #icon-suggestion
  • queen mirror
    #icon-queenmirror
  • phone bill
    #icon-phonebill
  • voice memo
    #icon-voicememo
  • scan read
    #icon-scanread
  • schedule
    #icon-schedule
  • tips money
    #icon-tipsmoney
  • voice shopping
    #icon-voiceshopping
  • to go
    #icon-togo
  • voiceprint
    #icon-voiceprint
  • xiami music
    #icon-xiamimusic
  • sleep mode
    #icon-sleepmode
  • Q&A
    #icon-QA
  • volume
    #icon-volume
  • cart
    #icon-cart
  • check surface
    #icon-checksurface
  • check
    #icon-check
  • birthday
    #icon-birthday
  • device off
    #icon-deviceoff
  • custom
    #icon-custom
  • diffuser stop area
    #icon-diffuserstoparea
  • diffuser stop
    #icon-diffuserstop
  • diffuser play
    #icon-diffuserplay
  • connect device
    #icon-connectdevice
  • cook
    #icon-cook
  • diffuser play area
    #icon-diffuserplayarea
  • device on
    #icon-deviceon
  • dinner
    #icon-dinner
  • done work
    #icon-donework
  • dislike
    #icon-dislike
  • get up
    #icon-getup
  • disconnect device
    #icon-disconnectdevice
  • get out
    #icon-getout
  • guests
    #icon-guests
  • feeding
    #icon-feeding
  • like
    #icon-like
  • mark
    #icon-mark
  • good night
    #icon-goodnight
  • meeting
    #icon-meeting
  • house cleaning
    #icon-housecleaning
  • go home
    #icon-gohome
  • hot
    #icon-hot
  • radio button unselect
    #icon-radiobuttonunselect
  • menu
    #icon-menu
  • radio button select
    #icon-radiobuttonselect
  • record
    #icon-record
  • meeting over
    #icon-meetingover
  • microphone off
    #icon-microphoneoff
  • share
    #icon-share
  • singing
    #icon-singing
  • series finale
    #icon-seriesfinale
  • put baby to bed
    #icon-putbabytobed
  • washing room
    #icon-washingroom
  • wake up baby
    #icon-wakeupbaby
  • watch series
    #icon-watchseries
  • take a break
    #icon-takeabreak
  • setting
    #icon-setting

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>