0.4.3 • Published 3 months ago

@hugsmidjan/gulp-iconfont v0.4.3

Weekly downloads
7
License
ISC
Repository
github
Last release
3 months ago

@hugsmidjan/gulp-iconfont

npm install --save-dev @hugsmidjan/gulp-iconfont

Usage

const [cssBundle, cssWatch] = require('@hugsmidjan/gulp-iconfont')(opts);

API / Advanced usage

const iconfontTaskFactory = require('@hugsmidjan/gulp-iconfont');

const options = {
  // These are the defaults:
  name: 'iconfont', // the display name of the generated tasks
  src: 'src/',
  dist: 'pub/i/',
  glob: 'iconfont/*.svg', // which files to use as entry points
  fontName: 'icons',
  // scssFile: '', // `options.src`-relative path, including filename
  // lessFile: '', // `options.src`-relative path, including filename
  // varPrefix: fontName + '-', // Custom prefix for less/css variables.
  // onGlyphs: null, // (glyphs:{ name: string, unicode: string[]}, options: object) => void
};

// Create the gulp tasks based on the above options.
const iconfontTasks = iconfontTaskFactory(options);

// iconfontTasks is a two item array...
const [iconfontBundle, iconfontWatch] = iconfontTasks;
// ...but it also exposes the tasks as named properties.
const { bundle, watch } = iconfontTasks;

This task generates a set of font-files along with the JSON file {{options.fontName}}.json which can be consumed by scripts or other tasks.

The scssFile and lessFile options generate LESS/SCSS files with the icon glyps as named variables.

0.4.3

3 months ago

0.4.2

3 months ago

0.4.1

3 months ago

0.4.0

2 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago