Intel AppFramework create and use your choice of IcoMoon icons
The Intel AppFramework uses a small subset of the IcoMoon icons. This post describes how to make your own selection of IcoMoon icons and use it in your app.
There is a free IcoMoon icon set with 490 icons available that we will use to make our selection from.
- Open the url https://icomoon.io/app/#/select
- Open the IcoMoon - Free icon set and select the icons you want to use in your app
- It is also possible to select all icons (we will do that for now)
- Select the Generate Font option at the bottom
- Press settings and select Font Name IcoMoon, select as Class Prefix icon. and select the option Encode & Embed Font in CSS
- Now click the download button
- Open the downloaded IcoMoon.zip file and copy the file style.cssto your styles folder as customicons.css
- Open de customicons.css file and compare with the file appframework/build/icons.css (we need to copy over the appframework specific styles)
- Remove the first four lines with a file-based @font-facedefinition, we will use the embeded one
@font-face { font-family: 'IcoMoon'; src: url('fonts/IcoMoon.eot'); }
- Replace:
.icon { font-family: 'IcoMoon'; speak: none; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1;
/* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } with (check appframework/build/icons.css for changes):
.icon:before { font-family:'IcoMoon'; speak:none; font-style:normal; font-weight:normal !important; font-variant:normal; text-transform:none; line-height:1; color:inherit; position:relative; font-size:1em; left:-3px; top:2px; } li .icon:before { position:relative; width:24px; height:100%; top:2px; line-height:0 !important; margin-right:4px; } .icon.mini:before { font-size:.7em; } .icon.big:before { font-size:1.5em; }
and we are done!
- In your main.css file include the appframework css files and your customicons.css file (or include directly in html):
@import url(../appframework/build/af.ui.base.css);
@import url(../appframework/build/af.ui.css);
@import url(customicons.css);