Sam Brook
http://iconmonstr.com/
https://thenounproject.com/
grunt-webfont
https://github.com/sapegin/grunt-webfont
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
webfont: {
icons: {
src: 'src/icons/*.svg',
destCss: 'build/assets/css/',
options: {
engine: 'node',
}
}
},
});
// Load the plugins
grunt.loadNpmTasks('grunt-webfont');
// Default task(s).
grunt.registerTask('default', ['webfont']);
};
All your .svgs
/* Generated by grunt-webfont */
@font-face {
font-family:"icons";
src:url("../fonts/icons.eot?a85957eab5f906c56cb7212f45127dae");
src:url("../fonts/icons.eot?#iefix") format("embedded-opentype"),
url("../fonts/icons.woff?a85957eab5f906c56cb7212f45127dae") format("woff"),
url("../fonts/icons.ttf?a85957eab5f906c56cb7212f45127dae") format("truetype");
font-weight:normal;
font-style:normal;
}
.icon {
font-family:"icons";
display:inline-block;
vertical-align:middle;
line-height:1;
font-weight:normal;
font-style:normal;
speak:none;
text-decoration:inherit;
text-transform:none;
text-rendering:auto;
-webkit-font-smoothing:antialiased;
-moz-osx-font-smoothing:grayscale;
}
icons.css
/* Icons */
.icon_code-page:before {
content:"\f101";
}
.icon_code-square:before {
content:"\f102";
}
.icon_css-code:before {
content:"\f103";
}
.icon_html-code:before {
content:"\f104";
}
.icon_javascript-code:before {
content:"\f105";
}
.icon_php-code:before {
content:"\f106";
}
.icon_source:before {
content:"\f107";
}
icons.css
Optional
webfont: {
icons: {
destCss: 'src/scss/',
options: {
engine: 'node',
stylesheet: 'scss',
relativeFontPath: '../fonts',
// template: 'src/templates/webfont.template.css',
// templateOptions: {
// baseClass: 'iconcss',
// classPrefix: 'icon-',
// elPrefix: 'i-'
}
}
}
},
/** Extends icon classes created by grunt-webfont
* @param (string) $icon - the icon to use (without icon- prefix)
*/
@mixin icon($icon, $size:false, $extendbase:true) {
@extend .icon-#{$icon};
@if($extendbase) {
@extend .iconcss;
}
@if($size) {
font-size: $size;
width: $size;
height: $size;
}
}
src/templates/webfont.template.css
Extending the default iconfont _icons.scss file
/* main.scss */
@import 'icons';
.subnav-item {
&:before { @include icon('php-code',30px); }
}
.php-icon {
&:before { @include icon('php-code',30px); }
}