1.0.2 • Published 3 years ago

@nycopportunity/pttrn-plugin-feather v1.0.2

Weekly downloads
8
License
GPL-3.0+
Repository
github
Last release
3 years ago

Patterns CLI Feather Plugin

This command plugin will compile a SVG icon sprite from the Feather Icon set.

Usage

Install as a development dependency in a project that uses the Patterns CLI.

$ npm install @nycopportunity/pttrn-plugin-feather -D

Add a proxy command script in the ./bin/ directory:

$ touch bin/feather.js
$ echo "module.exports = require('@nycopportunity/pttrn-plugin-feather');"

This will make the command available to the CLI. Compile the sprite by running:

$ npx pttrn feather
$ ✨ Feather sprite written to ./dist/svg/feather.svg

An optional config file can be added with the following options:

OptionDescription
srcThe source directory for Feather icons.
distThe distribution path and file name for the compiled sprite.
extThe extension name for the icons files (this shouldn't change).
prefixThe prefix to add to the <svg> element ID attribute.

Config Sample

const path = require('path');

module.exports = {
  'src': path.join(process.env.PWD, 'node_modules/feather-icons/dist/icons'),
  'dist': path.join(process.env.PWD, 'dist', 'svg', 'feather.svg'),
  'ext': '.svg',
  'prefix': 'feather-'
};