svgo-unique-id

1.0.0 • Public • Published

svgo-unique-id

If you are inlining SVGs on a web page, and they use ids internally, these id attributes must be unique across the entire page. This problem is exacerbated if you are using svgo to minify those ids. svgo-unique-id is a plugin for svgo that automatically prefixes the ids with a short hash of the contents of the entire svg. This hash is stable, and very unlikely not to be unique.

Installation

yarn add svgo-unique-id

Usage

new SVGO({
  plugins: [{
    uniqueID: require('svgo-unique-id'),
  }]
})

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i svgo-unique-id

Weekly Downloads

1,440

Version

1.0.0

License

none

Unpacked Size

8.65 kB

Total Files

4

Last publish

Collaborators

  • forbeslindesay