Back to Svgo

cleanupEnableBackground

docs/04-plugins/cleanupEnableBackground.mdx

4.0.1759 B
Original Source

Cleans up enable-background, unless the document uses <filter> elements.

Only cleans up attribute values and inline-styles, but does not affect stylesheets in <style> nodes.

This plugin will:

  • Drop enable-background when the width and height values match the width and height of the <svg> node.
  • Replace the value with new when the width and height values match the width and height of a <mask> or <pattern> node.

:::info

Some browsers don't support enable-background, so it's best to avoid the attribute regardless.

:::