New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

iconize

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iconize

Converts a bunch of SVG icons to CSS data URLs with PNG fallbacks

  • 0.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-55.56%
Maintainers
1
Weekly downloads
 
Created
Source

iconize

Converts a bunch of SVG icons to CSS data URLs with PNG fallbacks. Inspired by grunticon, but simpler and not requiring grunt.

Usage

iconize(files, options, done)

Takes an array of file paths and an options object. Available options are:

  • width: icon width (default: 32)

  • height: icon height (default: 32)

  • iconName: a function that takes a path to an svg file and returns an icon name suitable for inclusion in a filename and a CSS class name. Default: returns the basename of the file, without the extension, converted to lowercase and with all characters removed except letters, digits, hyphen and underscore.

  • svgCssPath: path to generated CSS file, SVG version (default: svg-icons.css)

  • pngCssPath: path to generated CSS file, PNG version (default: png-icons.css)

  • pngDir: path to the directory where PNG files are placed; will be created if nonexistent (default: png)

  • pngPrefix: path to PNG files used by CSS URLs (default: same as pngDir)

  • cssPrefix: prefix for CSS classes (default: icon-)

  • variants: a (possibly empty) array of objects with keys:

    • name: variant name to be appended to PNG file names
    • selector: CSS selector to be appended to CSS classes
    • transform: a function taking a string and returning another string.

Variants allow the creation of alternative versions of the icons by transforming the SVG (e.g., change the color on hover).

Keywords

FAQs

Package last updated on 10 Feb 2014

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc