Import icon fonts from icomoon.io
This plugin imports icon fonts downloaded from icomoon.io. When task is completed, zip file is renamed.
This plugin requires Grunt ~0.4.5
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-iconfonts --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-iconfonts');
In your project's Gruntfile, add a section named iconfonts
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
iconfonts: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
});
Type: String
Default value:
REQUIRED. Specify the location of downloaded icomoon zip file.
Type: String
Default value:
REQUIRED. Copy style.css from icomoon zip file to destination file.
Type: String
Default value: 'app/fonts'
Copy all fonts files from icomoon zip file to destination path.
Type: String
Default value: '../fonts'
Fonts path relative to css file in a web browser.
grunt.initConfig({
iconfonts: {
icomoon: {
options: {
src: '/Users/homer/Downloads/icomoon.zip',
cssDest: 'app/styles/base/_icons.scss',
}
}
},
});
To import icon fonts automatically every time you download zip file, add the following configuration.
grunt.initConfig({
watch: {
iconfonts: {
options: {
cwd: '/Users/homer/Downloads'
},
files: ['icomoon.zip'],
tasks: ['iconfonts']
}
},
iconfonts: {
icomoon: {
options: {
src: '/Users/homer/Downloads/icomoon.zip',
cssDest: 'app/styles/base/_icons.scss',
}
}
},
});
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
- 2015-02-07 v0.1.1 Publishing to npm
- 2015-02-07 v0.1.0 Initial release