PageSourceSearch

https://svgo.dev/assets/js/9d2b6995.dd11529b.js

js svgo.dev collected 2026-10-02 17:25:45 UTC 3,239 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunksvgo_dev=globalThis.webpackChunksvgo_dev||[]).push([[5897],{82:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>r,contentTitle:()=>c,default:()=>u,frontMatter:()=>a,metadata:()=>s,toc:()=>i});const s=JSON.parse('{"id":"plugins/cleanupEnableBackground","title":"cleanupEnableBackground","description":"Cleans up enable-background, unless the document uses <filter> elements.","source":"@site/svgo/docs/04-plugins/cleanupEnableBackground.mdx","sourceDirName":"04-plugins","slug":"/plugins/cleanupEnableBackground","permalink":"/docs/plugins/cleanupEnableBackground","draft":false,"unlisted":false,"editUrl":"https://github.com/svg/svgo/tree/main/docs/04-plugins/cleanupEnableBackground.mdx","tags":[],"version":"current","frontMatter":{"title":"cleanupEnableBackground","svgo":{"pluginId":"cleanupEnableBackground"}},"sidebar":"docsSidebar","previous":{"title":"cleanupAttrs","permalink":"/docs/plugins/cleanupAttrs"},"next":{"title":"cleanupIds","permalink":"/docs/plugins/cleanupIds"}}');var l=t(1684),o=t(506);const a={title:"cleanupEnableBackground",svgo:{pluginId:"cleanupEnableBackground"}},c=void 0,r={},i=[];function d(e){const n={a:"a",admonition:"admonition",code:"code",li:"li",p:"p",ul:"ul",...(0,o.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(n.p,{children:["Cleans up ",(0,l.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/enable-background",children:(0,l.jsx)(n.code,{children:"enable-background"})}),", unless the document uses ",(0,l.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/SVG/Element/filter",children:(0,l.jsx)(n.code,{children:"<filter>"})})," elements."]}),"\n",(0,l.jsxs)(n.p,{children:["Only cleans up attribute values and inline-styles, but does not affect stylesheets in ",(0,l.jsx)(n.a,{href:"https://developer.mozilla.org/en-US/docs/Web/SVG/Element/style",children:(0,l.jsx)(n.code,{children:"<style>"})})," nodes."]}),"\n",(0,l.jsx)(n.p,{children:"This plugin will:"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["Drop ",(0,l.jsx)(n.code,{children:"enable-background"})," when the width and height values match the width and height of the ",(0,l.jsx)(n.code,{children:"<svg>"})," node."]}),"\n",(0,l.jsxs)(n.li,{children:["Replace the value with ",(0,l.jsx)(n.code,{children:"new"})," when the width and height values match the width and height of a ",(0,l.jsx)(n.code,{children:"<mask>"})," or ",(0,l.jsx)(n.code,{children:"<pattern>"})," node."]}),"\n"]}),"\n",(0,l.jsx)(n.admonition,{type:"info",children:(0,l.jsxs)(n.p,{children:["Some browsers don't support ",(0,l.jsx)(n.code,{children:"enable-background"}),", so it's best to avoid the attribute regardless."]})})]})}function u(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(d,{...e})}):d(e)}},506:(e,n,t)=>{t.d(n,{R:()=>a,x:()=>c});var s=t(2888);const l={},o=s.createContext(l);function a(e){const n=s.useContext(o);return s.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:a(e.components),s.createElement(o.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.