Back to Svgo

addAttributesToSVGElement

docs/04-plugins/addAttributesToSVGElement.mdx

4.0.1430 B
Original Source

Adds attributes to the outer most <svg> element in the document. This is not an optimization and will increase the size of SVG documents.

:::danger

This plugin is only safe to use when a map of key/value pairs is passed. If you pass an array of keys to declare empty attributes, this will produce an malformed SVG that's only usable inline an HTML document.

:::