@hugsmidjan/gulp-iconfont
TypeScript icon, indicating that this package has built-in type declarations

0.4.3 • Public • Published

@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.

Readme

Keywords

none

Package Sidebar

Install

npm i @hugsmidjan/gulp-iconfont

Weekly Downloads

0

Version

0.4.3

License

ISC

Unpacked Size

8.03 kB

Total Files

5

Last publish

Collaborators

  • hugsmidjan-is
  • maranomynet