Socket
Socket
Sign inDemoInstall

@hugsmidjan/gulp-iconfont

Package Overview
Dependencies
488
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @hugsmidjan/gulp-iconfont

iconfont gulp task


Version published
Weekly downloads
2
decreased by-66.67%
Maintainers
2
Created
Weekly downloads
 

Changelog

Source

0.4.2 – 0.4.3

2024-01-30

  • feat: Add TypeScript types and JSDoc comments
  • fix: Accept the onGlyphs option, but still silently support the typo onGlyps

Readme

Source

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

FAQs

Last updated on 30 Jan 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc