nabil-mansouri / nativescript-nbmaterial

27 stars 5 forks source link

About Icon Magic #3

Closed empirefox closed 6 years ago

empirefox commented 6 years ago

Hi @nabil-mansouri. All icons here are used like this below, but i cannot find the source of dashboard. What's the magic and where are the other names? Thank you!

<bnav:Icon text="dashboard"  />
export class Icon extends Label {}
nabil-mansouri commented 6 years ago

Hi @empirefox! All is done through CSS: https://github.com/nabil-mansouri/nativescript-nbmaterial/blob/master/_demo/app/app.css

As you can see in this file, Icon component has font family value: material-icons

empirefox commented 6 years ago

The official doc says we should do it like String.fromCharCode(0xe903). How does it work when the dashboard to char code mapping does not exist?

empirefox commented 6 years ago

OK, finally i googled ligatures feature of css3 font. So close the issue now.