---
title: cleanupEnableBackground
svgo:
  pluginId: cleanupEnableBackground
  defaultPlugin: true
---

Cleans up [`enable-background`](https://developer.mozilla.org/docs/Web/SVG/Attribute/enable-background), unless the document uses [`<filter>`](https://developer.mozilla.org/docs/Web/SVG/Element/filter) elements.

Only cleans up attribute values and inline-styles, but does not affect stylesheets in [`<style>`](https://developer.mozilla.org/docs/Web/SVG/Element/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.

:::
