CINXE.COM

Manual:Coding conventions/SVG - MediaWiki

<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref--excluded vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>Manual:Coding conventions/SVG - MediaWiki</title> <script>(function(){var className="client-js vector-feature-language-in-header-disabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref--excluded vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-disabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )mediawikiwikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""], "wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"b402c292-a1a1-4ff5-a2ec-8e7b21920306","wgCanonicalNamespace":"Manual","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":100,"wgPageName":"Manual:Coding_conventions/SVG","wgTitle":"Coding conventions/SVG","wgCurRevisionId":6806061,"wgRevisionId":6806061,"wgArticleId":740452,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Development guidelines","SVG"],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Manual:Coding_conventions/SVG","wgRelevantArticleId":740452,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgRedirectedFrom":"CC/SVG","wgNoticeProject":"mediawiki","wgCiteReferencePreviewsActive":true,"wgMediaViewerOnClick": true,"wgMediaViewerEnabledByDefault":true,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":30000,"wgInternalRedirectTargetUrl":"/wiki/Manual:Coding_conventions/SVG","wgTranslatePageTranslation":"source","wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"personal","wgULSisCompactLinksEnabled":true,"wgVector2022LanguageInHeader":false,"wgULSisLanguageSelectorEmpty":false,"wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"]};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.translate.tag.languages":"ready","ext.pygments":"ready","ext.cite.styles": "ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","ext.translate.edit.documentation.styles":"ready","ext.translate":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.pt":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["mediawiki.action.view.redirect","ext.pygments.view","ext.cite.ux-enhancements","site","mediawiki.page.ready","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.translate.pagetranslation.uls","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.compactlinks","ext.uls.interface","ext.checkUser.clientHints"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=en&amp;modules=ext.cite.styles%7Cext.pygments%2Ctranslate%2CwikimediaBadges%7Cext.translate.edit.documentation.styles%7Cext.translate.tag.languages%7Cext.uls.pt%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediamessages.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&amp;only=styles&amp;skin=vector-2022"> <script async="" src="/w/load.php?lang=en&amp;modules=startup&amp;only=scripts&amp;raw=1&amp;skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&amp;modules=site.styles&amp;only=styles&amp;skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.4"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:site_name" content="MediaWiki"> <meta property="og:title" content="Manual:Coding conventions/SVG - MediaWiki"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//m.mediawiki.org/wiki/Manual:Coding_conventions/SVG"> <link rel="alternate" type="application/x-wiki" title="Edit" href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit"> <link rel="apple-touch-icon" href="/static/apple-touch/mediawiki.png"> <link rel="icon" href="/static/favicon/mediawiki.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="MediaWiki (en)"> <link rel="EditURI" type="application/rsd+xml" href="//www.mediawiki.org/w/api.php?action=rsd"> <link rel="canonical" href="https://www.mediawiki.org/wiki/Manual:Coding_conventions/SVG"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/"> <link rel="alternate" type="application/atom+xml" title="MediaWiki Atom feed" href="/w/index.php?title=Special:RecentChanges&amp;feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-100 ns-subject mw-editable page-Manual_Coding_conventions_SVG rootpage-Manual_Coding_conventions skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Jump to content</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Main menu" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Main menu</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Main menu</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">hide</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Navigation </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/MediaWiki" title="Visit the main page [z]" accesskey="z"><span>Main page</span></a></li><li id="n-mw-download" class="mw-list-item"><a href="/wiki/Download"><span>Get MediaWiki</span></a></li><li id="n-mw-extensions" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Category:Extensions"><span>Get extensions</span></a></li><li id="n-blog-text" class="mw-list-item"><a href="https://techblog.wikimedia.org/"><span>Tech blog</span></a></li><li id="n-mw-contribute" class="mw-list-item"><a href="/wiki/Special:MyLanguage/How_to_contribute"><span>Contribute</span></a></li> </ul> </div> </div> <div id="p-support" class="vector-menu mw-portlet mw-portlet-support" > <div class="vector-menu-heading"> Support </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-help" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Help:Contents" title="The place to find out"><span>User help</span></a></li><li id="n-mw-faq" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Manual:FAQ"><span>FAQ</span></a></li><li id="n-mw-manual" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Manual:Contents"><span>Technical manual</span></a></li><li id="n-mw-supportdesk" class="mw-list-item"><a href="/wiki/Project:Support_desk"><span>Support desk</span></a></li><li id="n-mw-communication" class="mw-list-item"><a href="/wiki/Special:MyLanguage/Communication"><span>Communication</span></a></li> </ul> </div> </div> <div id="p-development" class="vector-menu mw-portlet mw-portlet-development" > <div class="vector-menu-heading"> Development </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mw-developerportal" class="mw-list-item"><a href="https://developer.wikimedia.org/"><span>Developer portal</span></a></li><li id="n-svn-statistics" class="mw-list-item"><a href="/wiki/Development_statistics"><span>Code statistics</span></a></li> </ul> </div> </div> <div id="p-mediawiki.org" class="vector-menu mw-portlet mw-portlet-mediawiki_org" > <div class="vector-menu-heading"> mediawiki.org </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-portal" class="mw-list-item"><a href="/wiki/Project:Help" title="About the project, what you can do, where to find things"><span>Community portal</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Special:RecentChanges" title="A list of recent changes in the wiki [r]" accesskey="r"><span>Recent changes</span></a></li><li id="n-mw-translate" class="mw-list-item"><a href="/wiki/Special:LanguageStats"><span>Translate content</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Special:Random" title="Load a random page [x]" accesskey="x"><span>Random page</span></a></li><li id="n-mw-discussion" class="mw-list-item"><a href="/wiki/Project:Village_Pump"><span>Village pump</span></a></li><li id="n-Sandboxlink-portlet-label" class="mw-list-item"><a href="/wiki/Project:Sandbox"><span>Sandbox</span></a></li> </ul> </div> </div> <div id="p-lang" class="vector-menu mw-portlet mw-portlet-lang" > <div class="vector-menu-heading"> In other languages </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-add wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:NewItem?site=mediawikiwiki&amp;page=Manual%3ACoding+conventions%2FSVG" title="Add interlanguage links" class="wbc-editpage">Add links</a></span></div> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/MediaWiki" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/mediawikiwiki.svg" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="MediaWiki" src="/static/images/mobile/copyright/mediawikiwiki-wordmark.svg" style="width: 7.5em; height: 1.125em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/Special:Search" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Search MediaWiki [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Search</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Search MediaWiki" aria-label="Search MediaWiki" autocapitalize="sentences" title="Search MediaWiki [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Special:Search"> </div> <button class="cdx-button cdx-search-input__end-button">Search</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Personal tools"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-uls" class="mw-list-item active user-links-collapsible-item"><a data-mw="interface" href="#" class="uls-trigger cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet"><span class="vector-icon mw-ui-icon-wikimedia-language mw-ui-icon-wikimedia-wikimedia-language"></span> <span>English</span></a> </li> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Change the appearance of the page&#039;s font size, width, and color" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Appearance" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Appearance</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="https://donate.wikimedia.org/?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=spontaneous&amp;uselang=en" class=""><span>Donate</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:CreateAccount&amp;returnto=Manual%3ACoding+conventions%2FSVG" title="You are encouraged to create an account and log in; however, it is not mandatory" class=""><span>Create account</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:UserLogin&amp;returnto=Manual%3ACoding+conventions%2FSVG" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o" class=""><span>Log in</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="More options" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Personal tools" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Personal tools</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="User menu" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="https://donate.wikimedia.org/?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=spontaneous&amp;uselang=en"><span>Donate</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:CreateAccount&amp;returnto=Manual%3ACoding+conventions%2FSVG" title="You are encouraged to create an account and log in; however, it is not mandatory"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Create account</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:UserLogin&amp;returnto=Manual%3ACoding+conventions%2FSVG" title="You are encouraged to log in; however, it is not mandatory [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Log in</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> Pages for logged out editors <a href="/wiki/Help:Introduction" aria-label="Learn more about editing"><span>learn more</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/Special:MyContributions" title="A list of edits made from this IP address [y]" accesskey="y"><span>Contributions</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Special:MyTalk" title="Discussion about edits from this IP address [n]" accesskey="n"><span>Talk</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><!-- CentralNotice --></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="Contents" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">Contents</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">hide</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">Beginning</div> </a> </li> <li id="toc-Code_structure" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Code_structure"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>Code structure </span> </div> </a> <ul id="toc-Code_structure-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Automated_optimisation_(SVGO)" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Automated_optimisation_(SVGO)"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Automated optimisation (SVGO)</span> </div> </a> <button aria-controls="toc-Automated_optimisation_(SVGO)-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Automated optimisation (SVGO) subsection</span> </button> <ul id="toc-Automated_optimisation_(SVGO)-sublist" class="vector-toc-list"> <li id="toc-How_to_use" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#How_to_use"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.1</span> <span>How to use</span> </div> </a> <ul id="toc-How_to_use-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Safe_plugins:" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Safe_plugins:"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.2</span> <span>Safe plugins:</span> </div> </a> <ul id="toc-Safe_plugins:-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Exemplified_safe_configuration" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Exemplified_safe_configuration"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.3</span> <span>Exemplified safe configuration</span> </div> </a> <ul id="toc-Exemplified_safe_configuration-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Exemplified_safe_configuration_(.svgo.config.js)" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Exemplified_safe_configuration_(.svgo.config.js)"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.4</span> <span>Exemplified safe configuration (.svgo.config.js)</span> </div> </a> <ul id="toc-Exemplified_safe_configuration_(.svgo.config.js)-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Exemplified_safe_configuration_(Gruntfile.js)" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Exemplified_safe_configuration_(Gruntfile.js)"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.5</span> <span>Exemplified safe configuration (Gruntfile.js)</span> </div> </a> <ul id="toc-Exemplified_safe_configuration_(Gruntfile.js)-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Manual_optimisation" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Manual_optimisation"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>Manual optimisation</span> </div> </a> <ul id="toc-Manual_optimisation-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Other_tools" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Other_tools"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>Other tools</span> </div> </a> <button aria-controls="toc-Other_tools-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Other tools subsection</span> </button> <ul id="toc-Other_tools-sublist" class="vector-toc-list"> <li id="toc-scour" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#scour"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.1</span> <span>scour</span> </div> </a> <ul id="toc-scour-sublist" class="vector-toc-list"> <li id="toc-Description_and_history" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Description_and_history"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.1.1</span> <span>Description and history</span> </div> </a> <ul id="toc-Description_and_history-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-How_to_use_2" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#How_to_use_2"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.1.2</span> <span>How to use</span> </div> </a> <ul id="toc-How_to_use_2-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-safe_plugins" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#safe_plugins"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.1.3</span> <span>safe plugins</span> </div> </a> <ul id="toc-safe_plugins-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-svgcleaner" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#svgcleaner"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.2</span> <span>svgcleaner</span> </div> </a> <ul id="toc-svgcleaner-sublist" class="vector-toc-list"> <li id="toc-Description_and_history_2" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Description_and_history_2"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.2.1</span> <span>Description and history</span> </div> </a> <ul id="toc-Description_and_history_2-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-How_to_use_3" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#How_to_use_3"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.2.2</span> <span>How to use</span> </div> </a> <ul id="toc-How_to_use_3-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-safe_plugins_2" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#safe_plugins_2"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.2.3</span> <span>safe plugins</span> </div> </a> <ul id="toc-safe_plugins_2-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> </ul> </li> <li id="toc-References" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#References"> <div class="vector-toc-text"> <span class="vector-toc-numb">5</span> <span>References</span> </div> </a> <ul id="toc-References-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Contents" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Toggle the table of contents" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Toggle the table of contents</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-namespace">Manual</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">Coding conventions/SVG</span></h1> <div class="mw-indicators"> <div id="mw-indicator-tpl-shortcut" class="mw-indicator"><div class="mw-parser-output"><div class="mw-parser-output"><style data-mw-deduplicate="TemplateStyles:r6605561">.mw-parser-output .tpl-badge{background-color:var(--background-color-progressive-subtle,#eaf3ff);color:var(--color-base,#202122);border-radius:10px;display:inline-block;font-size:90%;padding:5px 8px}</style><div class="tpl-badge">shortcut: <a href="/wiki/CC/SVG" class="mw-redirect" title="CC/SVG"><b>CC/SVG</b></a></div></div></div></div> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Namespaces"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-manual" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Manual:Coding_conventions/SVG" title="View the subject page [c]" accesskey="c"><span>Manual</span></a></li><li id="ca-talk" class="vector-tab-noicon mw-list-item"><a href="/wiki/Manual_talk:Coding_conventions/SVG" rel="discussion" class="mw-redirect" title="Discussion about the content page [t]" accesskey="t"><span>Discussion</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Change language variant" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">English</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Views"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Manual:Coding_conventions/SVG"><span>Read</span></a></li><li id="ca-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit" title="Edit the source code of this page [e]" accesskey="e"><span>Edit</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=history" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Tools" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Tools</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Tools</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">hide</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="More options" > <div class="vector-menu-heading"> Actions </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/Manual:Coding_conventions/SVG"><span>Read</span></a></li><li id="ca-more-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit" title="Edit the source code of this page [e]" accesskey="e"><span>Edit</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=history"><span>View history</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> General </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Special:WhatLinksHere/Manual:Coding_conventions/SVG" title="A list of all wiki pages that link here [j]" accesskey="j"><span>What links here</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Special:RecentChangesLinked/Manual:Coding_conventions/SVG" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</span></a></li><li id="t-upload" class="mw-list-item"><a href="//commons.wikimedia.org/wiki/Special:UploadWizard" title="Upload files [u]" accesskey="u"><span>Upload file</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;oldid=6806061" title="Permanent link to this revision of this page"><span>Permanent link</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=info" title="More information about this page"><span>Page information</span></a></li><li id="t-cite" class="mw-list-item"><a href="/w/index.php?title=Special:CiteThisPage&amp;page=Manual%3ACoding_conventions%2FSVG&amp;id=6806061&amp;wpFormIdentifier=titleform" title="Information on how to cite this page"><span>Cite this page</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Special:UrlShortener&amp;url=https%3A%2F%2Fwww.mediawiki.org%2Fwiki%2FManual%3ACoding_conventions%2FSVG"><span>Get shortened URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Special:QrCode&amp;url=https%3A%2F%2Fwww.mediawiki.org%2Fwiki%2FManual%3ACoding_conventions%2FSVG"><span>Download QR code</span></a></li> </ul> </div> </div> <div id="p-coll-print_export" class="vector-menu mw-portlet mw-portlet-coll-print_export" > <div class="vector-menu-heading"> Print/export </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-create_a_book" class="mw-list-item"><a href="/w/index.php?title=Special:Book&amp;bookcmd=book_creator&amp;referer=Manual%3ACoding+conventions%2FSVG"><span>Create a book</span></a></li><li id="coll-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=Special:DownloadAsPdf&amp;page=Manual%3ACoding_conventions%2FSVG&amp;action=show-download-screen"><span>Download as PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;printable=yes" title="Printable version of this page [p]" accesskey="p"><span>Printable version</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects emptyPortlet" > <div class="vector-menu-heading"> In other projects </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Appearance</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">hide</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div id="siteSub" class="noprint">From mediawiki.org</div> </div> <div id="contentSub"><div id="mw-content-subtitle"><div class="subpages">&lt; <bdi dir="ltr"><a href="/wiki/Special:MyLanguage/Manual:Coding_conventions" title="Special:MyLanguage/Manual:Coding conventions">Manual:Coding conventions</a></bdi></div><span class="mw-redirectedfrom">(Redirected from <a href="/w/index.php?title=CC/SVG&amp;redirect=no" class="mw-redirect" title="CC/SVG">CC/SVG</a>)</span></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-pt-translate-header noprint nomobile" dir="ltr" lang="en"><a href="/w/index.php?title=Special:Translate&amp;group=page-Manual%3ACoding+conventions%2FSVG&amp;action=page&amp;filter=&amp;action_source=translate_page" title="Special:Translate">Translate this page</a></div><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><div class="mw-pt-languages noprint navigation-not-searchable" lang="en" dir="ltr"><div class="mw-pt-languages-label">Languages:</div><ul class="mw-pt-languages-list"><li><a href="/wiki/Manual:Coding_conventions/SVG/de" class="mw-pt-progress mw-pt-progress--low" title="Handbuch:Kodierungskonventionen/SVG (4% translated)" lang="de" dir="ltr">Deutsch</a></li> <li><span class="mw-pt-languages-ui mw-pt-languages-selected mw-pt-progress mw-pt-progress--complete" lang="en" dir="ltr">English</span></li> <li><a href="/wiki/Manual:Coding_conventions/SVG/pl" class="mw-pt-progress mw-pt-progress--low" title="Manual:Coding conventions/SVG/pl (3% translated)" lang="pl" dir="ltr">polski</a></li> <li><a href="/wiki/Manual:Coding_conventions/SVG/pt-br" class="mw-pt-progress mw-pt-progress--low" title="Manual:Convenções de codificação/SVG (7% translated)" lang="pt-BR" dir="ltr">português do Brasil</a></li> <li><a href="/wiki/Manual:Coding_conventions/SVG/cs" class="mw-pt-progress mw-pt-progress--complete" title="Příručka:Konvence pro psaní kódu/SVG (100% translated)" lang="cs" dir="ltr">čeština</a></li> <li><a href="/wiki/Manual:Coding_conventions/SVG/bn" class="mw-pt-progress mw-pt-progress--low" title="নির্দেশিকা:কোডিং প্রচলন/এসভিজি (13% translated)" lang="bn" dir="ltr">বাংলা</a></li> <li><a href="/wiki/Manual:Coding_conventions/SVG/ja" class="mw-pt-progress mw-pt-progress--low" title="Manual:コーディング規約/SVG (12% translated)" lang="ja" dir="ltr">日本語</a></li></ul></div> <style data-mw-deduplicate="TemplateStyles:r6651108">.mw-parser-output table.ombox{margin:4px 10%;border-collapse:collapse;border:1px solid #a2a9b1;background-color:#f8f9fa;color:#333;box-sizing:border-box}.mw-parser-output .ombox td.mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ombox th.mbox-text,.mw-parser-output .ombox td.mbox-text{border:none;padding:0.25em 0.9em;width:100%}.mw-parser-output .ombox td.mbox-image{border:none;text-align:center;padding:2px 0 2px 0.9em}.mw-parser-output .ombox td.mbox-imageright{border:none;text-align:center;padding:2px 0.9em 2px 0}.mw-parser-output table.ombox-notice{border-color:#a2a9b1}.mw-parser-output table.ombox-speedy{background-color:#fee7e6;color:#333}.mw-parser-output table.ombox-speedy,.mw-parser-output table.ombox-delete{border-color:#b32424;border-width:2px}.mw-parser-output table.ombox-content{border-color:#f28500}.mw-parser-output table.ombox-style{border-color:#fc3}.mw-parser-output table.ombox-move{border-color:#9932cc}.mw-parser-output table.ombox-protection{border-color:#a2a9b1;border-width:2px}html body.mediawiki .mw-parser-output .ombox.mbox-small{clear:right;float:right;margin:4px 0 4px 1em;box-sizing:border-box;width:238px;font-size:88%;line-height:1.25em}@media screen{html.skin-theme-clientpref-night .mw-parser-output table.ombox{background-color:transparent;color:inherit}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output table.ombox{background-color:transparent;color:inherit}}</style><table class="ombox ombox-notice plainlinks" role="presentation"><tbody><tr><td class="mbox-image"><span typeof="mw:File"><span><img src="//upload.wikimedia.org/wikipedia/commons/thumb/f/f6/OOjs_UI_icon_check-constructive.svg/30px-OOjs_UI_icon_check-constructive.svg.png" decoding="async" width="30" height="30" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/f/f6/OOjs_UI_icon_check-constructive.svg/45px-OOjs_UI_icon_check-constructive.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/f/f6/OOjs_UI_icon_check-constructive.svg/60px-OOjs_UI_icon_check-constructive.svg.png 2x" data-file-width="20" data-file-height="20" /></span></span></td><td class="mbox-text">This page documents a MediaWiki <a href="/wiki/Special:MyLanguage/Development_guidelines" title="Special:MyLanguage/Development guidelines">development guideline</a>, crafted over time by developer consensus (or sometimes by proclamation from a lead developer)</td></tr></tbody></table> <p>This page describes the <b>coding conventions</b> used within files of the <a href="/wiki/Special:MyLanguage/Manual:Code" title="Special:MyLanguage/Manual:Code">MediaWiki codebase</a> written in <b>SVG</b>. See also the <a href="/wiki/Special:MyLanguage/Manual:Coding_conventions#All_languages" title="Special:MyLanguage/Manual:Coding conventions">general conventions</a> which apply to all programming and markup languages, including SVG. </p><p>We make use of <a rel="nofollow" class="external text" href="https://github.com/svg/svgo">SVGO</a> as optimisation tool, see <a href="#Automated_optimisation_(SVGO)">automated optimisation</a> below. </p> <div style="clear: right; margin-bottom: .5em; float: right; margin-left:2em; width: auto;"><meta property="mw:PageProp/toc" /></div> <div class="mw-heading mw-heading2"><h2 id="Code_structure">Code structure&#160;</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=1" title="Edit section: Code structure "><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Minimal code as possible with readability in mind is the premise. </p><p>Example for simple optimised file – <a href="https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/src/themes/wikimediaui/images/icons/subtract.svg" class="extiw" title="phab:diffusion/GOJU/browse/master/src/themes/wikimediaui/images/icons/subtract.svg">subtract.svg from OOUI</a>: </p> <div class="mw-highlight mw-highlight-lang-xml mw-content-ltr" dir="ltr"><pre><span></span><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span> <span class="nt">&lt;svg</span><span class="w"> </span><span class="na">xmlns=</span><span class="s">&quot;http://www.w3.org/2000/svg&quot;</span><span class="w"> </span><span class="na">width=</span><span class="s">&quot;20&quot;</span><span class="w"> </span><span class="na">height=</span><span class="s">&quot;20&quot;</span><span class="w"> </span><span class="na">viewBox=</span><span class="s">&quot;0 0 20 20&quot;</span><span class="nt">&gt;</span> <span class="w"> </span><span class="nt">&lt;title&gt;</span> <span class="w"> </span>subtract <span class="w"> </span><span class="nt">&lt;/title&gt;</span> <span class="w"> </span><span class="nt">&lt;path</span><span class="w"> </span><span class="na">d=</span><span class="s">&quot;M4 9h12v2H4z&quot;</span><span class="nt">/&gt;</span> <span class="nt">&lt;/svg&gt;</span> </pre></div> <p>For minimalists, <i>exactly the same</i> can be drawn with </p> <div class="mw-highlight mw-highlight-lang-xml mw-content-ltr" dir="ltr"><pre><span></span><span class="cp">&lt;?xml version=&quot;1.0&quot;?&gt;</span> <span class="nt">&lt;svg</span><span class="w"> </span><span class="na">xmlns=</span><span class="s">&quot;http://www.w3.org/2000/svg&quot;</span><span class="w"> </span><span class="na">width=</span><span class="s">&quot;20&quot;</span><span class="w"> </span><span class="na">height=</span><span class="s">&quot;20&quot;</span><span class="nt">&gt;</span> <span class="w"> </span><span class="nt">&lt;path</span><span class="w"> </span><span class="na">d=</span><span class="s">&quot;m4,9h12v2H4&quot;</span><span class="nt">/&gt;</span> <span class="nt">&lt;/svg&gt;</span> </pre></div> <p>Example for slightly more complex, optimised file – BetaFeatures screenshot template: </p> <div class="mw-highlight mw-highlight-lang-xml mw-content-ltr" dir="ltr"><pre><span></span><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span> <span class="nt">&lt;svg</span><span class="w"> </span><span class="na">xmlns=</span><span class="s">&quot;http://www.w3.org/2000/svg&quot;</span><span class="w"> </span><span class="na">width=</span><span class="s">&quot;264&quot;</span><span class="w"> </span><span class="na">height=</span><span class="s">&quot;162&quot;</span><span class="w"> </span><span class="na">viewBox=</span><span class="s">&quot;0 0 264 162&quot;</span><span class="nt">&gt;</span> <span class="w"> </span><span class="nt">&lt;title&gt;</span> <span class="w"> </span>BetaFeatures<span class="w"> </span>screenshot<span class="w"> </span>template <span class="w"> </span><span class="nt">&lt;/title&gt;</span> <span class="w"> </span><span class="nt">&lt;defs&gt;</span> <span class="w"> </span><span class="nt">&lt;clipPath</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;jagged-edge&quot;</span><span class="nt">&gt;</span> <span class="w"> </span><span class="nt">&lt;path</span><span class="w"> </span><span class="na">d=</span><span class="s">&quot;M0 0v152l12 10 12-10 12 10 12-10 12 10 12-10 12 10 12-10 12 10 12-10 12 10 12-10 12 10 12-10 12 10 12-10 12 10 12-10 12 10 12-10 12 10 12-10V0z&quot;</span><span class="nt">/&gt;</span> <span class="w"> </span><span class="nt">&lt;/clipPath&gt;</span> <span class="w"> </span><span class="nt">&lt;/defs&gt;</span> <span class="w"> </span><span class="nt">&lt;g</span><span class="w"> </span><span class="na">fill=</span><span class="s">&quot;#eaecf0&quot;</span><span class="w"> </span><span class="na">clip-path=</span><span class="s">&quot;url(#jagged-edge)&quot;</span><span class="nt">&gt;</span> <span class="w"> </span><span class="nt">&lt;path</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;background&quot;</span><span class="w"> </span><span class="na">fill=</span><span class="s">&quot;#fff&quot;</span><span class="w"> </span><span class="na">d=</span><span class="s">&quot;M0 0h264v162H0&quot;</span><span class="nt">/&gt;</span> <span class="w"> </span><span class="nt">&lt;path</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;logo&quot;</span><span class="w"> </span><span class="na">d=</span><span class="s">&quot;M11 22c0-8 6-14 14-14s14 6 14 14-6 14-14 14-14-6-14-14M38 45v-5H13v5h25&quot;</span><span class="nt">/&gt;</span> <span class="w"> </span><span class="nt">&lt;path</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;sidebar&quot;</span><span class="w"> </span><span class="na">d=</span><span class="s">&quot;M38 163V58H13v106h25&quot;</span><span class="nt">/&gt;</span> <span class="w"> </span><span class="nt">&lt;path</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;personal-tools&quot;</span><span class="w"> </span><span class="na">d=</span><span class="s">&quot;M233 5h26v6h-26V5zM209 5h22v6h-22zM185 5h22v6h-22zM162 5h13v6h-13zM177 5h6v6h-6zM154 5h6v6h-6z&quot;</span><span class="nt">/&gt;</span> <span class="w"> </span><span class="nt">&lt;path</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;search-input&quot;</span><span class="w"> </span><span class="na">d=</span><span class="s">&quot;M258 16v4h-92v-4h92m1-1h-94v6h94v-6z&quot;</span><span class="nt">/&gt;</span> <span class="w"> </span><span class="nt">&lt;path</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;search-icon&quot;</span><span class="w"> </span><span class="na">d=</span><span class="s">&quot;M168 17h2v2h-2z&quot;</span><span class="nt">/&gt;</span> <span class="w"> </span><span class="nt">&lt;path</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;article&quot;</span><span class="w"> </span><span class="na">d=</span><span class="s">&quot;M252 162V29H48v133z&quot;</span><span class="nt">/&gt;</span> <span class="w"> </span><span class="nt">&lt;path</span><span class="w"> </span><span class="na">id=</span><span class="s">&quot;border&quot;</span><span class="w"> </span><span class="na">d=</span><span class="s">&quot;M0 0v162h264V0zm1 1h262v150.533l-11 9.166-12-10-12 10-12-10-12 10-12-10-12 10-12-10-12 10-12-10-12 10-12-10-12 10-12-10-12 10-12-10-12 10-12-10-12 10-12-10-12 10-11-9z&quot;</span><span class="nt">/&gt;</span> <span class="w"> </span><span class="nt">&lt;/g&gt;</span> <span class="nt">&lt;/svg&gt;</span> </pre></div> <p>We will explain the different coding conventions in the following section. </p> <div class="mw-heading mw-heading2"><h2 id="Automated_optimisation_(SVGO)"><span id="Automated_optimisation_.28SVGO.29"></span>Automated optimisation (SVGO)</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=2" title="Edit section: Automated optimisation (SVGO)"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>SVGO was maintained by Kir Belevich (deepsweet<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">&#91;</span>1<span class="cite-bracket">&#93;</span></a></sup>) and Lev Solntsev (GreLI<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">&#91;</span>2<span class="cite-bracket">&#93;</span></a></sup>) from August 2012<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">&#91;</span>3<span class="cite-bracket">&#93;</span></a></sup> to 2016<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">&#91;</span>4<span class="cite-bracket">&#93;</span></a></sup><sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">&#91;</span>5<span class="cite-bracket">&#93;</span></a></sup> and since 2021 by Bogdan Chadkin (TrySound<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">&#91;</span>6<span class="cite-bracket">&#93;</span></a></sup>). </p> <div class="mw-heading mw-heading3"><h3 id="How_to_use">How to use</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=3" title="Edit section: How to use"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Is it recommended to install <code>svgo</code> from <a rel="nofollow" class="external free" href="https://github.com/svg/svgo">https://github.com/svg/svgo</a> or from <code>npm</code> for the command line. There is also an in-browser demo to help with preview and general understanding of the tool at <a rel="nofollow" class="external free" href="https://jakearchibald.github.io/svgomg/">https://jakearchibald.github.io/svgomg/</a>. This should not be used to create production files however. </p> <div class="mw-heading mw-heading3"><h3 id="Safe_plugins:">Safe plugins:</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=4" title="Edit section: Safe plugins:"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>As some SVGO default plugins (options) might result in unexpected appearance with more complex SVGs, we differentiate between safe, considerably less-safe and unsafe plugins. Set the "transformPrecision" at least to 7 to reduce the rist of breaking files.<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">&#91;</span>7<span class="cite-bracket">&#93;</span></a></sup> When using unsafe plugins it's recommended to verify before and after diffing per file to ensure visual quality. </p><p>Mentioning only plugins, that are changed from default setting or that might be counter-intuitive: </p> <ul><li>Sorting attributes <code>sortAttrs</code>.<br />Enable by setting to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">true</span></code>; disabled by default</li> <li>Remove or cleanup <code>enable-background</code> attribute when possible <code>cleanupEnableBackground</code>.<br />Deprecated attribute, only supported by IE/Edge; enabled by default</li></ul> <p>See <a rel="nofollow" class="external text" href="https://github.com/svg/svgo">SVGO Readme for other enabled, safe plugins</a>. </p><p><b>Plugins to consider carefully:</b>&#160; </p> <table class="wikitable"> <tbody><tr> <td><code>cleanupIDs</code> </td> <td>Remove unused and minify used IDs<br />Might negatively affect readability<sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">&#91;</span>8<span class="cite-bracket">&#93;</span></a></sup> and breaks some files<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">&#91;</span>9<span class="cite-bracket">&#93;</span></a></sup>; enabled by default </td></tr> <tr> <td><code>removeRasterImages</code> </td> <td>As general rule dangerous, could cause data loss, some raster-images are difficult to spot<sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">&#91;</span>10<span class="cite-bracket">&#93;</span></a></sup>; disabled by default </td></tr> <tr> <td><code>inlineStyles</code> </td> <td>Some users prefer to use CSS than inlineStyles, can reduce editability<sup id="cite_ref-11" class="reference"><a href="#cite_note-11"><span class="cite-bracket">&#91;</span>11<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>removeDoctype</code> </td> <td>For SVG 1.1 there is not reason to remove it, however for the upcommong SVG2-draft it will be deapreciated<sup id="cite_ref-12" class="reference"><a href="#cite_note-12"><span class="cite-bracket">&#91;</span>12<span class="cite-bracket">&#93;</span></a></sup> </td></tr></tbody></table> <p><b>Unsafe rules to disable (don't use!):</b> </p> <table class="wikitable"> <tbody><tr> <td><code>convertPathData</code> </td> <td>Might cause (i) imprecise rendering, (ii) wrong rendering by librsvg<sup id="cite_ref-13" class="reference"><a href="#cite_note-13"><span class="cite-bracket">&#91;</span>13<span class="cite-bracket">&#93;</span></a></sup>, (iii) breaking files<sup id="cite_ref-14" class="reference"><a href="#cite_note-14"><span class="cite-bracket">&#91;</span>14<span class="cite-bracket">&#93;</span></a></sup><sup id="cite_ref-15" class="reference"><a href="#cite_note-15"><span class="cite-bracket">&#91;</span>15<span class="cite-bracket">&#93;</span></a></sup><sup id="cite_ref-16" class="reference"><a href="#cite_note-16"><span class="cite-bracket">&#91;</span>16<span class="cite-bracket">&#93;</span></a></sup>; enabled by default </td></tr> <tr> <td><code>cleanupListOfValues</code> </td> <td>Round/rewrite number lists breaks Wikimedia-renderin<sup id="cite_ref-17" class="reference"><a href="#cite_note-17"><span class="cite-bracket">&#91;</span>17<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>convertShapeToPath</code> </td> <td>can reduce readability<sup id="cite_ref-notConvert_18-0" class="reference"><a href="#cite_note-notConvert-18"><span class="cite-bracket">&#91;</span>18<span class="cite-bracket">&#93;</span></a></sup> and breaks files<sup id="cite_ref-19" class="reference"><a href="#cite_note-19"><span class="cite-bracket">&#91;</span>19<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>removeXMLProcInst</code> </td> <td>Remove XML processing instructions, aka XML declaration<sup id="cite_ref-20" class="reference"><a href="#cite_note-20"><span class="cite-bracket">&#91;</span>20<span class="cite-bracket">&#93;</span></a></sup><sup id="cite_ref-21" class="reference"><a href="#cite_note-21"><span class="cite-bracket">&#91;</span>21<span class="cite-bracket">&#93;</span></a></sup> <code class="mw-highlight mw-highlight-lang-xml mw-content-ltr" dir="ltr"><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span></code> <br />Issues when viewed as standalone file in some editors, also possible issues with MIME type interpretation<br />Example: If the SVG doesn't start with an XML declaration, then its MIME type will be detected as <code>text/plain</code> rather than <code>image/svg+xml</code> by libmagic and consequently, MediaWiki's CSSMin CSS minifier. libmagic's default database currently requires that <a rel="nofollow" class="external text" href="https://github.com/threatstack/libmagic/blob/master/magic/Magdir/sgml#L5">SVGs contain an XML declaration</a>; disable by setting to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code>; enabled by default </td></tr> <tr> <td><code>removeTitle</code> </td> <td>Remove <code class="mw-highlight" style="white-space:nowrap"><span class="p">&#8206;&lt;</span><span class="nt">title</span><span class="p">&gt;</span></code> <br />Problematic for accessibility reasons<sup id="cite_ref-22" class="reference"><a href="#cite_note-22"><span class="cite-bracket">&#91;</span>22<span class="cite-bracket">&#93;</span></a></sup>; set to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code>; enabled by default </td></tr> <tr> <td><code>removeDesc</code> </td> <td>Remove <code class="mw-highlight" style="white-space:nowrap"><span class="p">&#8206;&lt;</span><span class="nt">desc</span><span class="p">&gt;</span></code><br />Problematic for accessibility reasons; set to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code>; enabled by default </td></tr> <tr> <td><code>removeViewBox</code> </td> <td>Remove <code>viewBox</code> attribute<br />Results in troublesome appearance in some browsers, therefore both, <code>width</code>/<code>height</code> and <code>viewbox</code> should be featured; set to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code>; enabled by default </td></tr> <tr> <td><code>removeDimensions</code> </td> <td>Remove dimensions <code>width</code>/<code>height</code> when <code>viewbox</code> is available<br />As above; set to <code class="mw-highlight mw-highlight-lang-php mw-content-ltr" style="" dir="ltr"><span class="k">false</span></code>; disabled by default </td></tr> <tr> <td><code>removeMetadata</code> </td> <td>Possible Copyright-Information<sup id="cite_ref-invalidkept_23-0" class="reference"><a href="#cite_note-invalidkept-23"><span class="cite-bracket">&#91;</span>23<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>removeHiddenElems</code> </td> <td>Possible reference lines, editor data, real text before convertion, Copyright-informations<sup id="cite_ref-invalidkept_23-1" class="reference"><a href="#cite_note-invalidkept-23"><span class="cite-bracket">&#91;</span>23<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>removeUnknownsAndDefaults</code> </td> <td>removes <a href="https://commons.wikimedia.org/wiki/User:JoKalliauer/RepairFlowRoot" class="extiw" title="c:User:JoKalliauer/RepairFlowRoot">Flow-Text</a> <sup id="cite_ref-24" class="reference"><a href="#cite_note-24"><span class="cite-bracket">&#91;</span>24<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>cleanupNumericValues</code> </td> <td>breaks some files <sup id="cite_ref-25" class="reference"><a href="#cite_note-25"><span class="cite-bracket">&#91;</span>25<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>minifyStyles</code> </td> <td>breaks some files<sup id="cite_ref-26" class="reference"><a href="#cite_note-26"><span class="cite-bracket">&#91;</span>26<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>removeComments</code> </td> <td>reduces readability and possible removes reference lines, editor data, real text before convertion, Copyright-informations<sup id="cite_ref-27" class="reference"><a href="#cite_note-27"><span class="cite-bracket">&#91;</span>27<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>removeEditorsNSData</code> </td> <td>reduces editability with GUI-SVG-Editors<sup id="cite_ref-28" class="reference"><a href="#cite_note-28"><span class="cite-bracket">&#91;</span>28<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>collapseGroups</code> </td> <td>reduced readability and editability <sup id="cite_ref-29" class="reference"><a href="#cite_note-29"><span class="cite-bracket">&#91;</span>29<span class="cite-bracket">&#93;</span></a></sup> and breaks some files<sup id="cite_ref-30" class="reference"><a href="#cite_note-30"><span class="cite-bracket">&#91;</span>30<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>removeStyleElement</code> </td> <td>breaks some files<sup id="cite_ref-31" class="reference"><a href="#cite_note-31"><span class="cite-bracket">&#91;</span>31<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>removeOffCanvasPaths</code> </td> <td>breaks some files<sup id="cite_ref-32" class="reference"><a href="#cite_note-32"><span class="cite-bracket">&#91;</span>32<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>removeEmptyContainers</code> </td> <td>breaks some files<sup id="cite_ref-33" class="reference"><a href="#cite_note-33"><span class="cite-bracket">&#91;</span>33<span class="cite-bracket">&#93;</span></a></sup><sup id="cite_ref-34" class="reference"><a href="#cite_note-34"><span class="cite-bracket">&#91;</span>34<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>removeElementsByAttr</code> </td> <td>breaks some files<sup id="cite_ref-35" class="reference"><a href="#cite_note-35"><span class="cite-bracket">&#91;</span>35<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>convertStyleToAttrs</code> </td> <td>breaks some files<sup id="cite_ref-36" class="reference"><a href="#cite_note-36"><span class="cite-bracket">&#91;</span>36<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>convertTransform</code> </td> <td>breaks some files<sup id="cite_ref-37" class="reference"><a href="#cite_note-37"><span class="cite-bracket">&#91;</span>37<span class="cite-bracket">&#93;</span></a></sup><sup id="cite_ref-38" class="reference"><a href="#cite_note-38"><span class="cite-bracket">&#91;</span>38<span class="cite-bracket">&#93;</span></a></sup><sup id="cite_ref-39" class="reference"><a href="#cite_note-39"><span class="cite-bracket">&#91;</span>39<span class="cite-bracket">&#93;</span></a></sup><sup id="cite_ref-40" class="reference"><a href="#cite_note-40"><span class="cite-bracket">&#91;</span>40<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>cleanupNumericValues</code> </td> <td>breaks some files <sup id="cite_ref-41" class="reference"><a href="#cite_note-41"><span class="cite-bracket">&#91;</span>41<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>inlineStyles</code> </td> <td>breaks some CSS-features<sup id="cite_ref-42" class="reference"><a href="#cite_note-42"><span class="cite-bracket">&#91;</span>42<span class="cite-bracket">&#93;</span></a></sup> </td></tr> <tr> <td><code>reusePaths</code> </td> <td>breaks some files <sup id="cite_ref-43" class="reference"><a href="#cite_note-43"><span class="cite-bracket">&#91;</span>43<span class="cite-bracket">&#93;</span></a></sup> </td></tr></tbody></table> <p><br /> </p> <div class="mw-heading mw-heading3"><h3 id="Exemplified_safe_configuration">Exemplified safe configuration</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=5" title="Edit section: Exemplified safe configuration"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Note that this is for SVGO v1.x; v2.x takes different CLI arguments: </p><p><code>$ svgo path/to/image.svg --disable={cleanupIDs,convertPathData,removeDesc,removeTitle,removeViewBox,removeXMLProcInst} --enable='sortAttrs' --pretty --final-newline</code> </p><p>Use <code>pretty</code> output for human readable code and in the process indent code by tabs. </p> <div class="mw-heading mw-heading3"><h3 id="Exemplified_safe_configuration_(.svgo.config.js)"><span id="Exemplified_safe_configuration_.28.svgo.config.js.29"></span>Exemplified safe configuration (.svgo.config.js)</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=6" title="Edit section: Exemplified safe configuration (.svgo.config.js)"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p><b>June 2023</b> - SVGO v3.0.0+ compatibility, amending to new <code>cleanupIds</code> plugin name. (<a href="https://phabricator.wikimedia.org/T324899" class="extiw" title="phab:T324899">phab:T324899</a>) </p><p><b>January 2022</b> - NPM run scripts enabled SVGO configuration. (<a href="https://phabricator.wikimedia.org/T246321" class="extiw" title="phab:T246321">phab:T246321</a>) </p> <div class="mw-highlight mw-highlight-lang-js mw-content-ltr" dir="ltr"><pre><span></span><span class="cm">/**</span> <span class="cm"> * SVGO Configuration</span> <span class="cm"> * Compatible to v3.0.0+</span> <span class="cm"> * Recommended options from:</span> <span class="cm"> * https://www.mediawiki.org/wiki/Manual:Coding_conventions/SVG#Exemplified_safe_configuration</span> <span class="cm"> */</span> <span class="s1">&#39;use strict&#39;</span><span class="p">;</span> <span class="nx">module</span><span class="p">.</span><span class="nx">exports</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">plugins</span><span class="o">:</span><span class="w"> </span><span class="p">[</span> <span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="c1">// Set of built-in plugins enabled by default.</span> <span class="w"> </span><span class="nx">name</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;preset-default&#39;</span><span class="p">,</span> <span class="w"> </span><span class="nx">params</span><span class="o">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">overrides</span><span class="o">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">cleanupIds</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span> <span class="w"> </span><span class="nx">removeDesc</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span> <span class="w"> </span><span class="nx">removeTitle</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span> <span class="w"> </span><span class="nx">removeViewBox</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="p">,</span> <span class="w"> </span><span class="c1">// If the SVG doesn&#39;t start with an XML declaration, then its MIME type will be detected as &quot;text/plain&quot; rather than &quot;image/svg+xml&quot; by libmagic and, consequently, MediaWiki&#39;s CSSMin CSS minifier.</span> <span class="w"> </span><span class="c1">// libmagic&#39;s default database currently requires that SVGs contain an XML declaration:</span> <span class="w"> </span><span class="c1">// https://github.com/threatstack/libmagic/blob/master/magic/Magdir/sgml#L5</span> <span class="w"> </span><span class="nx">removeXMLProcInst</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="c1">// https://phabricator.wikimedia.org/T327446</span> <span class="w"> </span><span class="nx">convertPathData</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="c1">// https://github.com/svg/svgo/issues/880 https://github.com/svg/svgo/issues/1487</span> <span class="w"> </span><span class="nx">removeMetadata</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="c1">// Copyright-Violation</span> <span class="w"> </span><span class="nx">removeHiddenElems</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="c1">// source for converted text2path</span> <span class="w"> </span><span class="nx">removeUnknownsAndDefaults</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="c1">// removes Flow-Text: https://commons.wikimedia.org/wiki/User:JoKalliauer/RepairFlowRoot</span> <span class="w"> </span><span class="nx">cleanupNumericValues</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="c1">// https://github.com/svg/svgo/issues/1080</span> <span class="w"> </span><span class="nx">minifyStyles</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="c1">//https://github.com/svg/svgo/issues/888</span> <span class="w"> </span><span class="nx">removeComments</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="c1">//reduces readability</span> <span class="w"> </span><span class="nx">removeEditorsNSData</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="c1">// https://github.com/svg/svgo/issues/1096</span> <span class="w"> </span><span class="nx">collapseGroups</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="c1">// https://github.com/svg/svgo/issues/1057</span> <span class="w"> </span><span class="nx">removeOffCanvasPaths</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="c1">//https://github.com/svg/svgo/issues/1732</span> <span class="w"> </span><span class="nx">removeEmptyContainers</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="c1">// https://github.com/svg/svgo/issues/1194 https://github.com/svg/svgo/issues/1618</span> <span class="w"> </span><span class="nx">convertTransform</span><span class="o">:</span><span class="w"> </span><span class="nx">fasle</span><span class="w"> </span><span class="c1">// https://github.com/svg/svgo/issues/988 https://github.com/svg/svgo/issues/1021</span> <span class="w"> </span><span class="nx">cleanupNumericValues</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="c1">// https://github.com/svg/svgo/issues/1080</span> <span class="w"> </span><span class="nx">inlineStyles</span><span class="o">:</span><span class="w"> </span><span class="kc">false</span><span class="w"> </span><span class="c1">// https://github.com/svg/svgo/issues/1486</span> <span class="w"> </span><span class="p">}</span> <span class="w"> </span><span class="p">}</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="s1">&#39;removeRasterImages&#39;</span><span class="p">,</span> <span class="w"> </span><span class="s1">&#39;sortAttrs&#39;</span> <span class="w"> </span><span class="p">],</span> <span class="w"> </span><span class="c1">// Set whitespace according to Wikimedia Coding Conventions.</span> <span class="w"> </span><span class="c1">// @see https://github.com/svg/svgo/blob/main/lib/stringifier.js#L39 for available options.</span> <span class="w"> </span><span class="nx">js2svg</span><span class="o">:</span><span class="w"> </span><span class="p">{</span> <span class="w"> </span><span class="nx">eol</span><span class="o">:</span><span class="w"> </span><span class="s1">&#39;lf&#39;</span><span class="p">,</span> <span class="w"> </span><span class="nx">finalNewline</span><span class="o">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span> <span class="w"> </span><span class="c1">// Configure the indent to tabs (default 4 spaces) used by &#39;--pretty&#39; here.</span> <span class="w"> </span><span class="nx">indent</span><span class="o">:</span><span class="w"> </span><span class="s2">&quot;\t&quot;</span><span class="p">,</span> <span class="w"> </span><span class="nx">pretty</span><span class="o">:</span><span class="w"> </span><span class="kc">true</span> <span class="w"> </span><span class="p">},</span> <span class="w"> </span><span class="nx">multipass</span><span class="o">:</span><span class="w"> </span><span class="kc">true</span> <span class="p">}</span> </pre></div> <div class="mw-heading mw-heading3"><h3 id="Exemplified_safe_configuration_(Gruntfile.js)"><span id="Exemplified_safe_configuration_.28Gruntfile.js.29"></span>Exemplified safe configuration (Gruntfile.js)</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=7" title="Edit section: Exemplified safe configuration (Gruntfile.js)"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <pre lang="js">svgmin: { options: { js2svg: { indent: '\t', pretty: true }, plugins: [ { cleanupIDs: false }, { removeDesc: false }, { removeRasterImages: true }, { removeTitle: false }, { removeViewBox: false }, { removeXMLProcInst: false }, { sortAttrs: true }, { convertPathData: false // https://github.com/svg/svgo/issues/880 }, { removeMetadata: false // Copyright-Violation }, { removeHiddenElems: false // source for converted text2path }, { removeUnknownsAndDefaults: false // removes Flow-Text }, { cleanupNumericValues: false // https://github.com/svg/svgo/issues/1080 }, { minifyStyles: false //https://github.com/svg/svgo/issues/888 }, { removeComments: false //reduces readability }, { removeEditorsNSData: false // https://github.com/svg/svgo/issues/1096 }, { collapseGroups: false // https://github.com/svg/svgo/issues/1057 }, { removeOffCanvasPaths: false //https://github.com/svg/svgo/issues/1732 }, { removeEmptyContainers:false // https://github.com/svg/svgo/issues/1194 https://github.com/svg/svgo/issues/1618 }, { convertTransform: fasle // https://github.com/svg/svgo/issues/988 https://github.com/svg/svgo/issues/1021 }, { cleanupNumericValues: false // https://github.com/svg/svgo/issues/1080 }, { inlineStyles: false // https://github.com/svg/svgo/issues/1486 } ] } } </pre> <div class="mw-heading mw-heading2"><h2 id="Manual_optimisation">Manual optimisation</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=8" title="Edit section: Manual optimisation"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Beyond automated optimising SVGs there are further steps to consider: </p> <ul><li>retain the following code <code>xml:space="preserve"</code>, <code>&lt;!--</code>, <code>&lt;title</code>, <code>\n</code>, <code>\r</code>, <code>\t</code>, <code>&lt;g</code>, <code>visibility="hidden"</code>, <code>opacity="0"</code>, <code>display="none"</code>, <code>requiredFeatures="</code>, <code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;</code>, <code class="mw-highlight" style="white-space:nowrap"><span class="p">&#8206;&lt;</span><span class="nt">defs</span><span class="p">&gt;</span></code>, <code>&lt;rect</code>, <code>&lt;style type="text/css"</code>, <code> class="</code>, <code>data-name=</code>, <code>inkscape:label</code>, <code>&lt;rdf:RDF</code>, <code>aria-label=</code>, <code>&lt;inkscape:grid</code>, <code>&lt;sodipodi:guide</code>, <code>sodipodi:cx=</code>, <code>sodipodi:cy=</code>, <code>sodipodi:rx=</code>, <code>sodipodi:ry=</code>, <code>sodipodi:type="arc"</code>, <code>vector-effect=</code>, <code>inkscape:groupmode="layer"</code>, <code>inkscape:label=</code>, <code>sodipodi:role="line"</code>, see <a href="https://commons.wikimedia.org/wiki/Help:SVG_guidelines#When_is_optimizing/validating_files_undesired?" class="extiw" title="c:Help:SVG guidelines">c:Help:SVG guideline</a></li> <li>Remove <code>standalone="no"</code> from XML processing instruction, as it's default</li> <li>Lowercase (for better gzipping) and shorten hex color values, if possible, e.g. <code>#fff</code> instead of <code>#FFFFFF</code>.</li> <li>Attributes that are the same for a group of elements can be applied to a common parent <code class="mw-highlight" style="white-space:nowrap"><span class="p">&#8206;&lt;</span><span class="nt">g</span><span class="p">&gt;</span></code> instead, or sometimes even specified by the <code>&lt;svg</code> statement (see an example: <a href="https://commons.wikimedia.org/wiki/File_talk:CHE_Bettens_COA.svg" class="extiw" title="c:File talk:CHE Bettens COA.svg">CHE Bettens COA.svg</a>).<br />This might reduce the editability or readability</li> <li>Rely on defaults like <code>fill="#000"</code> and <code>stroke-width="1"</code>.</li> <li>The <code class="mw-highlight mw-highlight-lang-html mw-content-ltr" dir="ltr"><span class="p">&lt;</span><span class="nt">path</span> <span class="na">d</span><span class="o">=</span><span class="s">&quot;…&quot;</span><span class="p">/&gt;</span></code> syntax is almost always shorter than the syntax of basic shapes like <code class="mw-highlight" style="white-space:nowrap"><span class="p">&#8206;&lt;</span><span class="nt">polygon</span><span class="p">&gt;</span></code> or even <code class="mw-highlight" style="white-space:nowrap"><span class="p">&#8206;&lt;</span><span class="nt">rect</span><span class="p">&gt;</span></code>, however <code class="mw-highlight" style="white-space:nowrap"><span class="p">&#8206;&lt;</span><span class="nt">circle</span><span class="p">&gt;</span></code>, <code class="mw-highlight" style="white-space:nowrap"><span class="p">&#8206;&lt;</span><span class="nt">ellipse</span><span class="p">&gt;</span></code>, <code class="mw-highlight" style="white-space:nowrap"><span class="p">&#8206;&lt;</span><span class="nt">rect</span><span class="p">&gt;</span></code> are generally more easy to read/edit, therfore there is generally prefered to use more specific ones.</li> <li>Merge <code class="mw-highlight mw-highlight-lang-html mw-content-ltr" dir="ltr"><span class="p">&lt;</span><span class="nt">path</span> <span class="na">d</span><span class="o">=</span><span class="s">&quot;…&quot;</span><span class="p">/&gt;</span></code> elements where applicable. Do not do that if the both path should be edited speratly.</li> <li>Do not remove redundant <code>ry="…"</code> attribute when identical to <code>rx="…"</code> it get's more difficult to read/edit.</li> <li>Remove not needed <code>fill-rule="…"</code> and <code>clip-rule="…"</code>. These rules only have an effect on certain paths, e.g. when a path intersects itself.</li> <li>Look for <a href="https://en.wikipedia.org/wiki/IEEE_754" class="extiw" title="w:IEEE 754">IEEE</a> rounding errors like <code>0.999999998</code> or <code>1.000000003</code>. Such numbers take up space without providing any additional information. They can almost always be cut off without visually changing anything.</li> <li>Work with a non-fractional pixel grid while drawing, and align as much points as possible on this grid. These points have a much higher chance of being represented as short integer numbers in the resulting code.</li> <li>Pick a non-fractional grid so that it matches the features of an existing image, and scale or redraw shapes so that as many points as possible fall on the grid. The result might be misaligned and can be cropped using <code>viewBox="<i>&lt;left&gt; &lt;top&gt; &lt;width&gt; &lt;height&gt;</i>"</code>.</li></ul> <p>If you want to dig even deeper, there are <a rel="nofollow" class="external text" href="https://blog.usejournal.com/of-svg-minification-and-gzip-21cd26a5d007">more optimisations to compress delivery</a>, such as: </p> <ul><li>auto-closing paths (aka removing <code>z</code> for certain shapes),</li> <li>use relative commands when creating paths (instead of absolute commands, e.g. "m" for "move by", instead of "M" for "move to"),</li> <li>optimising for compression backreferences</li></ul> <div class="mw-heading mw-heading2"><h2 id="Other_tools">Other tools</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=9" title="Edit section: Other tools"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Other tools that may be helpful to know about: </p> <ol><li><a class="external text" href="https://svgworkaroundbot.toolforge.org/">SvgWorkAroundBot</a></li> <li><a rel="nofollow" class="external text" href="https://jakearchibald.github.io/svgomg/">SVGOMG</a></li> <li><a rel="nofollow" class="external text" href="https://github.com/scour-project/scour">scour</a></li> <li><a rel="nofollow" class="external text" href="https://github.com/RazrFalcon/svgcleaner">svgcleaner</a></li> <li>check <a href="https://commons.wikimedia.org/wiki/Help:SVG_guidelines#How_to_optimize" class="extiw" title="commons:Help:SVG guidelines">Help:SVG guidelines#How to optimize</a> for more options.</li></ol> <div class="mw-heading mw-heading3"><h3 id="scour">scour</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=10" title="Edit section: scour"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="mw-heading mw-heading4"><h4 id="Description_and_history">Description and history</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=11" title="Edit section: Description and history"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>This optimizer was one of the first optimizers: Since 2009 it included with the installation of Inkscape, it can be used by saving Inkscape-files with "Optimized Inkscape SVG", and in 2013<sup id="cite_ref-45" class="reference"><a href="#cite_note-45"><span class="cite-bracket">&#91;</span>45<span class="cite-bracket">&#93;</span></a></sup> seperated into an self-contained project available at <a rel="nofollow" class="external free" href="https://github.com/scour-project/scour">https://github.com/scour-project/scour</a>. It is maintained by the Inscape-Developer Patrick Storz (Ede123).<sup id="cite_ref-44" class="reference"><a href="#cite_note-44"><span class="cite-bracket">&#91;</span>44<span class="cite-bracket">&#93;</span></a></sup> </p> <div class="mw-heading mw-heading4"><h4 id="How_to_use_2">How to use</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=12" title="Edit section: How to use"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>You can use in the browser at <a class="external free" href="https://svgworkaroundbot.toolforge.org/">https://svgworkaroundbot.toolforge.org/</a> or install it via <code>pip install scour</code> from the command line (Linux-PC/Mac-PC/Windows). </p> <div class="mw-heading mw-heading4"><h4 id="safe_plugins">safe plugins</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=13" title="Edit section: safe plugins"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Scour is a very cautious optimizer, however some plugins can still be break the file or remove important non-visible parts, to be on the safe side you can use <code>scour -i input.svg -o output.svg --disable-simplify-colors --disable-style-to-xml --disable-group-collapsing --keep-editor-data --keep-unreferenced-defs --protect-ids-noninkscape --disable-embed-rasters --set-precision=8 --set-c-precision=8</code> </p> <div class="mw-heading mw-heading3"><h3 id="svgcleaner">svgcleaner</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=14" title="Edit section: svgcleaner"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="mw-heading mw-heading4"><h4 id="Description_and_history_2">Description and history</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=15" title="Edit section: Description and history"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>This optimizer was developed from Jan 2012 to 2022 by Yevhenii Reizner.<sup id="cite_ref-46" class="reference"><a href="#cite_note-46"><span class="cite-bracket">&#91;</span>46<span class="cite-bracket">&#93;</span></a></sup> It focusses on following the current w3c-Standards (SVG1.1).<sup id="cite_ref-47" class="reference"><a href="#cite_note-47"><span class="cite-bracket">&#91;</span>47<span class="cite-bracket">&#93;</span></a></sup> Compared to scour or svgo it breaks less files<sup id="cite_ref-48" class="reference"><a href="#cite_note-48"><span class="cite-bracket">&#91;</span>48<span class="cite-bracket">&#93;</span></a></sup>, reduces the file size more<sup id="cite_ref-49" class="reference"><a href="#cite_note-49"><span class="cite-bracket">&#91;</span>49<span class="cite-bracket">&#93;</span></a></sup> and the performance is magnitues faster.<sup id="cite_ref-50" class="reference"><a href="#cite_note-50"><span class="cite-bracket">&#91;</span>50<span class="cite-bracket">&#93;</span></a></sup> </p> <div class="mw-heading mw-heading4"><h4 id="How_to_use_3">How to use</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=16" title="Edit section: How to use"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>You can use in the browser at <a class="external free" href="https://svgworkaroundbot.toolforge.org/">https://svgworkaroundbot.toolforge.org/</a> or download it from <a rel="nofollow" class="external free" href="https://github.com/RazrFalcon/svgcleaner-gui/releases">https://github.com/RazrFalcon/svgcleaner-gui/releases</a> . </p> <div class="mw-heading mw-heading4"><h4 id="safe_plugins_2">safe plugins</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=17" title="Edit section: safe plugins"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Files will be treated according to the standards, however sometimes file non-svg-elements which are important for reading and/or editing the file, to be on the safe side you can use <code>svgcleaner input.svg output.svg --allow-bigger-file --indent yes --resolve-use no --apply-transform-to-gradients yes --apply-transform-to-shapes yes --convert-shapes no --group-by-style no --join-arcto-flags no --join-style-attributes no --merge-gradients yes --regroup-gradient-stops yes --remove-comments no --remove-declarations no --remove-default-attributes yes --remove-desc no --remove-dupl-cmd-in-paths yes --remove-dupl-fegaussianblur yes --remove-dupl-lineargradient yes --remove-dupl-radialgradient yes --remove-gradient-attributes yes --remove-invalid-stops yes --remove-invisible-elements no --remove-metadata no --remove-needless-attributes yes --remove-nonsvg-attributes no --remove-nonsvg-elements no --remove-text-attributes no --remove-title no --remove-unreferenced-ids no --remove-unresolved-classes yes --remove-unused-coordinates yes --remove-unused-defs yes --remove-version yes --remove-xmlns-xlink-attribute yes --simplify-transforms yes --trim-colors yes --trim-ids no --trim-paths yes --ungroup-defs yes --ungroup-groups no --use-implicit-cmds yes --list-separator comma --paths-to-relative yes --remove-unused-segments yes --convert-segments yes --apply-transform-to-paths yes --coordinates-precision 2 --paths-coordinates-precision 5 --properties-precision 3 --transforms-precision 7</code> </p> <div class="mw-heading mw-heading2"><h2 id="References">References</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Manual:Coding_conventions/SVG&amp;action=edit&amp;section=18" title="Edit section: References"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="mw-references-wrap mw-references-columns"><ol class="references"> <li id="cite_note-1"><span class="mw-cite-backlink"><a href="#cite_ref-1">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/deepsweet">https://github.com/deepsweet</a></span> </li> <li id="cite_note-2"><span class="mw-cite-backlink"><a href="#cite_ref-2">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/GreLI">https://github.com/GreLI</a></span> </li> <li id="cite_note-3"><span class="mw-cite-backlink"><a href="#cite_ref-3">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/commit/b1f3a62809e5b6f73c4ebae4bc792cb18f5ce6c5">https://github.com/svg/svgo/commit/b1f3a62809e5b6f73c4ebae4bc792cb18f5ce6c5</a></span> </li> <li id="cite_note-4"><span class="mw-cite-backlink"><a href="#cite_ref-4">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://github.com/svg/svgo/issues/1055">Still maintained?</a></span> </li> <li id="cite_note-5"><span class="mw-cite-backlink"><a href="#cite_ref-5">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external text" href="https://github.com/svg/svgo/issues/1320">Call for new maintainer(s)</a></span> </li> <li id="cite_note-6"><span class="mw-cite-backlink"><a href="#cite_ref-6">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/TrySound">https://github.com/TrySound</a></span> </li> <li id="cite_note-7"><span class="mw-cite-backlink"><a href="#cite_ref-7">↑</a></span> <span class="reference-text"> <a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1021">https://github.com/svg/svgo/issues/1021</a></span> </li> <li id="cite_note-8"><span class="mw-cite-backlink"><a href="#cite_ref-8">↑</a></span> <span class="reference-text"><a href="https://commons.wikimedia.org/wiki/Help:SVG_guidelines#Invalid_elements_that_should_be_replaced" class="extiw" title="c:Help:SVG guidelines">c:Help:SVG_guidelines#Invalid elements that should be replaced</a> (id=)</span> </li> <li id="cite_note-9"><span class="mw-cite-backlink"><a href="#cite_ref-9">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1195">https://github.com/svg/svgo/issues/1195</a></span> </li> <li id="cite_note-10"><span class="mw-cite-backlink"><a href="#cite_ref-10">↑</a></span> <span class="reference-text"><a href="https://commons.wikimedia.org/wiki/Help:SVG_guidelines#Optimizing_SVGs_that_have_already_been_uploaded" class="extiw" title="c:Help:SVG guidelines">c:Help:SVG_guidelines#Optimizing SVGs that have already been uploaded</a> (You should not change the appearance of the picture, see <a href="/wiki/File:Oxygen15.04.1-computer-laptop.svg" title="File:Oxygen15.04.1-computer-laptop.svg">File:Oxygen15.04.1-computer-laptop.svg</a>)</span> </li> <li id="cite_note-11"><span class="mw-cite-backlink"><a href="#cite_ref-11">↑</a></span> <span class="reference-text"><a href="https://commons.wikimedia.org/wiki/Help:SVG_guidelines#Elements_that_should_not_be_converted" class="extiw" title="c:Help:SVG guidelines">c:Help:SVG_guidelines#Elements that should not be converted</a> (CSS should in general not be converted)</span> </li> <li id="cite_note-12"><span class="mw-cite-backlink"><a href="#cite_ref-12">↑</a></span> <span class="reference-text"><a href="https://commons.wikimedia.org/wiki/Help:SVG_guidelines#Useless_elements_that_should_be_kept" class="extiw" title="c:Help:SVG guidelines">c:Help:SVG_guidelines#Useless elements that should be kept</a>; there are different opinions about it, but it is necessary for <a rel="nofollow" class="external free" href="https://validator.w3.org/">https://validator.w3.org/</a>.</span> </li> <li id="cite_note-13"><span class="mw-cite-backlink"><a href="#cite_ref-13">↑</a></span> <span class="reference-text"><a href="https://phabricator.wikimedia.org/T217990" class="extiw" title="phab:T217990">phab:T217990</a></span> </li> <li id="cite_note-14"><span class="mw-cite-backlink"><a href="#cite_ref-14">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/880">https://github.com/svg/svgo/issues/880</a></span> </li> <li id="cite_note-15"><span class="mw-cite-backlink"><a href="#cite_ref-15">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1487">https://github.com/svg/svgo/issues/1487</a></span> </li> <li id="cite_note-16"><span class="mw-cite-backlink"><a href="#cite_ref-16">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1493">https://github.com/svg/svgo/issues/1493</a></span> </li> <li id="cite_note-17"><span class="mw-cite-backlink"><a href="#cite_ref-17">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1402">https://github.com/svg/svgo/issues/1402</a></span> </li> <li id="cite_note-notConvert-18"><span class="mw-cite-backlink"><a href="#cite_ref-notConvert_18-0">↑</a></span> <span class="reference-text"><a href="https://commons.wikimedia.org/wiki/Help:SVG_guidelines#Elements_that_should_not_be_converted" class="extiw" title="c:Help:SVG guidelines">c:Help:SVG_guidelines#Elements that should not be converted</a> (rect should often not be converted to path)</span> </li> <li id="cite_note-19"><span class="mw-cite-backlink"><a href="#cite_ref-19">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1402">https://github.com/svg/svgo/issues/1402</a></span> </li> <li id="cite_note-20"><span class="mw-cite-backlink"><a href="#cite_ref-20">↑</a></span> <span class="reference-text"><a href="https://phabricator.wikimedia.org/T327446" class="extiw" title="phab:T327446">phab:T327446</a></span> </li> <li id="cite_note-21"><span class="mw-cite-backlink"><a href="#cite_ref-21">↑</a></span> <span class="reference-text"><a class="external free" href="https://commons.wikimedia.org/w/index.php?title=Commons:Commons_SVG_Checker&amp;withJS=MediaWiki:CommonsSvgChecker.js">https://commons.wikimedia.org/w/index.php?title=Commons:Commons_SVG_Checker&amp;withJS=MediaWiki:CommonsSvgChecker.js</a> (WARNING: XML declaration not found and is strongly recommended)</span> </li> <li id="cite_note-22"><span class="mw-cite-backlink"><a href="#cite_ref-22">↑</a></span> <span class="reference-text"><a href="https://commons.wikimedia.org/wiki/Help:SVG_guidelines#Useless_elements_that_should_be_kept" class="extiw" title="c:Help:SVG guidelines">c:Help:SVG_guidelines#Useless elements that should be kept</a>; titles are used to describe/name the file.</span> </li> <li id="cite_note-invalidkept-23"><span class="mw-cite-backlink">↑ <sup><a href="#cite_ref-invalidkept_23-0">23.0</a></sup> <sup><a href="#cite_ref-invalidkept_23-1">23.1</a></sup></span> <span class="reference-text"><a href="https://commons.wikimedia.org/wiki/Help:SVG_guidelines#Invalid_elements_that_should_be_kept" class="extiw" title="c:Help:SVG guidelines">c:Help:SVG_guidelines#Invalid elements that should be kept</a></span> </li> <li id="cite_note-24"><span class="mw-cite-backlink"><a href="#cite_ref-24">↑</a></span> <span class="reference-text"><a href="https://commons.wikimedia.org/wiki/Help:SVG_guidelines#Invalid_elements_that_should_be_replaced" class="extiw" title="c:Help:SVG guidelines">c:Help:SVG_guidelines#Invalid elements that should be replaced</a>; (removes Flowtext)</span> </li> <li id="cite_note-25"><span class="mw-cite-backlink"><a href="#cite_ref-25">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1080">https://github.com/svg/svgo/issues/1080</a></span> </li> <li id="cite_note-26"><span class="mw-cite-backlink"><a href="#cite_ref-26">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/888">https://github.com/svg/svgo/issues/888</a></span> </li> <li id="cite_note-27"><span class="mw-cite-backlink"><a href="#cite_ref-27">↑</a></span> <span class="reference-text"><a href="https://commons.wikimedia.org/wiki/Help:SVG_guidelines#Useless_elements_that_should_be_kept" class="extiw" title="c:Help:SVG guidelines">c:Help:SVG_guidelines#Useless elements that should be kept</a> (comments explain things in the source code)</span> </li> <li id="cite_note-28"><span class="mw-cite-backlink"><a href="#cite_ref-28">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1096">https://github.com/svg/svgo/issues/1096</a>; keep grid and guide</span> </li> <li id="cite_note-29"><span class="mw-cite-backlink"><a href="#cite_ref-29">↑</a></span> <span class="reference-text"><a href="https://commons.wikimedia.org/wiki/Help:SVG_guidelines#Useless_elements_that_should_be_kept" class="extiw" title="c:Help:SVG guidelines">c:Help:SVG_guidelines#Useless elements that should be kept</a> (Groups are used to group elements.)</span> </li> <li id="cite_note-30"><span class="mw-cite-backlink"><a href="#cite_ref-30">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1057">https://github.com/svg/svgo/issues/1057</a></span> </li> <li id="cite_note-31"><span class="mw-cite-backlink"><a href="#cite_ref-31">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/946">https://github.com/svg/svgo/issues/946</a></span> </li> <li id="cite_note-32"><span class="mw-cite-backlink"><a href="#cite_ref-32">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1732">https://github.com/svg/svgo/issues/1732</a></span> </li> <li id="cite_note-33"><span class="mw-cite-backlink"><a href="#cite_ref-33">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1194">https://github.com/svg/svgo/issues/1194</a></span> </li> <li id="cite_note-34"><span class="mw-cite-backlink"><a href="#cite_ref-34">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1618">https://github.com/svg/svgo/issues/1618</a></span> </li> <li id="cite_note-35"><span class="mw-cite-backlink"><a href="#cite_ref-35">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/945">https://github.com/svg/svgo/issues/945</a></span> </li> <li id="cite_note-36"><span class="mw-cite-backlink"><a href="#cite_ref-36">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1735">https://github.com/svg/svgo/issues/1735</a></span> </li> <li id="cite_note-37"><span class="mw-cite-backlink"><a href="#cite_ref-37">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/988">https://github.com/svg/svgo/issues/988</a></span> </li> <li id="cite_note-38"><span class="mw-cite-backlink"><a href="#cite_ref-38">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1021">https://github.com/svg/svgo/issues/1021</a></span> </li> <li id="cite_note-39"><span class="mw-cite-backlink"><a href="#cite_ref-39">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1222">https://github.com/svg/svgo/issues/1222</a></span> </li> <li id="cite_note-40"><span class="mw-cite-backlink"><a href="#cite_ref-40">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1268">https://github.com/svg/svgo/issues/1268</a></span> </li> <li id="cite_note-41"><span class="mw-cite-backlink"><a href="#cite_ref-41">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1080">https://github.com/svg/svgo/issues/1080</a></span> </li> <li id="cite_note-42"><span class="mw-cite-backlink"><a href="#cite_ref-42">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1486">https://github.com/svg/svgo/issues/1486</a></span> </li> <li id="cite_note-43"><span class="mw-cite-backlink"><a href="#cite_ref-43">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/svg/svgo/issues/1733">https://github.com/svg/svgo/issues/1733</a></span> </li> <li id="cite_note-44"><span class="mw-cite-backlink"><a href="#cite_ref-44">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/Ede123">https://github.com/Ede123</a></span> </li> <li id="cite_note-45"><span class="mw-cite-backlink"><a href="#cite_ref-45">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/scour-project/scour/commits/master?after=0609c596766ec98e4e2092b49bd03b802702ba1a+279&amp;branch=master&amp;qualified_name=refs%2Fheads%2Fmaster">https://github.com/scour-project/scour/commits/master?after=0609c596766ec98e4e2092b49bd03b802702ba1a+279&amp;branch=master&amp;qualified_name=refs%2Fheads%2Fmaster</a></span> </li> <li id="cite_note-46"><span class="mw-cite-backlink"><a href="#cite_ref-46">↑</a></span> <span class="reference-text"> <a rel="nofollow" class="external free" href="https://github.com/RazrFalcon">https://github.com/RazrFalcon</a></span> </li> <li id="cite_note-47"><span class="mw-cite-backlink"><a href="#cite_ref-47">↑</a></span> <span class="reference-text"> <a rel="nofollow" class="external free" href="https://www.w3.org/TR/SVG11/">https://www.w3.org/TR/SVG11/</a></span> </li> <li id="cite_note-48"><span class="mw-cite-backlink"><a href="#cite_ref-48">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/RazrFalcon/svgcleaner#cleaning-ratio">https://github.com/RazrFalcon/svgcleaner#cleaning-ratio</a></span> </li> <li id="cite_note-49"><span class="mw-cite-backlink"><a href="#cite_ref-49">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/RazrFalcon/svgcleaner#cleaning-ratio">https://github.com/RazrFalcon/svgcleaner#cleaning-ratio</a></span> </li> <li id="cite_note-50"><span class="mw-cite-backlink"><a href="#cite_ref-50">↑</a></span> <span class="reference-text"><a rel="nofollow" class="external free" href="https://github.com/RazrFalcon/svgcleaner#cleaning-time">https://github.com/RazrFalcon/svgcleaner#cleaning-time</a></span> </li> </ol></div> <div class="navbox-styles nomobile"><style data-mw-deduplicate="TemplateStyles:r6230902">.mw-parser-output .navbox{border:1px solid #aaa;box-sizing:border-box;width:100%;margin:auto;clear:both;font-size:88%;text-align:center;padding:1px}.mw-parser-output .navbox-inner,.mw-parser-output .navbox-subgroup{width:100%}.mw-parser-output .navbox+.navbox-styles+.navbox{margin-top:-1px}.mw-parser-output .navbox th,.mw-parser-output .navbox-title,.mw-parser-output .navbox-abovebelow{text-align:center;padding-left:1em;padding-right:1em}.mw-parser-output th.navbox-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox,.mw-parser-output .navbox-subgroup{background:#fdfdfd}.mw-parser-output .navbox-list{border-color:#fdfdfd}.mw-parser-output .navbox th,.mw-parser-output .navbox-title{background:#eaeeff}.mw-parser-output .navbox-abovebelow,.mw-parser-output th.navbox-group,.mw-parser-output .navbox-subgroup .navbox-title{background:#ddddff}.mw-parser-output .navbox-subgroup .navbox-group,.mw-parser-output .navbox-subgroup .navbox-abovebelow{background:#e6e6ff}.mw-parser-output .navbox-even{background:#f7f7f7}.mw-parser-output .navbox-odd{background:transparent}.mw-parser-output th.navbox-title1{border-left:2px solid #fdfdfd;width:100%}.mw-parser-output td.navbox-list1{text-align:left;border-left-width:2px;border-left-style:solid}.mw-parser-output .navbox .hlist td dl,.mw-parser-output .navbox .hlist td ol,.mw-parser-output .navbox .hlist td ul,.mw-parser-output .navbox td.hlist dl,.mw-parser-output .navbox td.hlist ol,.mw-parser-output .navbox td.hlist ul{padding:0.125em 0}.mw-parser-output .navbox .hlist dd,.mw-parser-output .navbox .hlist dt,.mw-parser-output .navbox .hlist li{white-space:nowrap}.mw-parser-output .navbox .hlist dd dl,.mw-parser-output .navbox .hlist dt dl,.mw-parser-output .navbox .hlist li ol,.mw-parser-output .navbox .hlist li ul{white-space:normal}.mw-parser-output ol+.navbox-styles+.navbox,.mw-parser-output ul+.navbox-styles+.navbox{margin-top:0.5em}</style></div><div role="navigation" class="navbox" aria-labelledby="Development_guidelines" style="border: 1px solid #aaa; padding: 3px;;padding:3px"><table class="nowraplinks hlist navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><style data-mw-deduplicate="TemplateStyles:r6387430">.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li,.mw-parser-output .hlist .mw-empty-elt{display:none}.mw-parser-output .hlist dt:after{content:": "}.mw-parser-output .hlist dd:after,.mw-parser-output .hlist li:after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child:after,.mw-parser-output .hlist dt:last-child:after,.mw-parser-output .hlist li:last-child:after{content:none}.mw-parser-output .hlist dd dd:first-child:before,.mw-parser-output .hlist dd dt:first-child:before,.mw-parser-output .hlist dd li:first-child:before,.mw-parser-output .hlist dt dd:first-child:before,.mw-parser-output .hlist dt dt:first-child:before,.mw-parser-output .hlist dt li:first-child:before,.mw-parser-output .hlist li dd:first-child:before,.mw-parser-output .hlist li dt:first-child:before,.mw-parser-output .hlist li li:first-child:before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child:after,.mw-parser-output .hlist dd dt:last-child:after,.mw-parser-output .hlist dd li:last-child:after,.mw-parser-output .hlist dt dd:last-child:after,.mw-parser-output .hlist dt dt:last-child:after,.mw-parser-output .hlist dt li:last-child:after,.mw-parser-output .hlist li dd:last-child:after,.mw-parser-output .hlist li dt:last-child:after,.mw-parser-output .hlist li li:last-child:after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li:before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child:before,.mw-parser-output .hlist dt ol>li:first-child:before,.mw-parser-output .hlist li ol>li:first-child:before{content:" ("counter(listitem)"\a0 "}</style><style data-mw-deduplicate="TemplateStyles:r4692751">.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar ul{display:inline;white-space:nowrap}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em;width:6em}</style><div class="plainlinks hlist navbar mini"><ul><li class="nv-view"><a href="/wiki/Template:Development_guidelines_navigation" title="Template:Development guidelines navigation"><abbr title="View this template" style=";;background:none transparent;border:none;box-shadow:none; padding:0;">v</abbr></a></li><li class="nv-talk"><a href="/wiki/Template_talk:Development_guidelines_navigation" title="Template talk:Development guidelines navigation"><abbr title="Discuss this template" style=";;background:none transparent;border:none;box-shadow:none; padding:0;">t</abbr></a></li><li class="nv-edit"><a class="external text" href="https://www.mediawiki.org/w/index.php?title=Template:Development_guidelines_navigation&amp;action=edit"><abbr title="Edit this template" style=";;background:none transparent;border:none;box-shadow:none; padding:0;">e</abbr></a></li></ul></div><div id="Development_guidelines" style="font-size:114%;margin:0 4em"><a href="/wiki/Special:MyLanguage/Development_guidelines" title="Special:MyLanguage/Development guidelines"><span style="font-weight: bold;">Development guidelines</span></a><span style="display:none"><a href="/wiki/Development_guidelines" title="Development guidelines"> </a></span></div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%">Policies</th><td class="navbox-list1 navbox-list navbox-odd" style="width:100%;padding:0px"><div style="padding:0em 0.25em"> <ul><li><a href="/wiki/Special:MyLanguage/Development_policy" title="Special:MyLanguage/Development policy">Development policy</a><span style="display:none"><a href="/wiki/Development_policy" title="Development policy"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Wikimedia_Engineering_Architecture_Principles" title="Special:MyLanguage/Wikimedia Engineering Architecture Principles">Architecture principles</a><span style="display:none"><a href="/wiki/Wikimedia_Engineering_Architecture_Principles" title="Wikimedia Engineering Architecture Principles"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Wikimedia_services_policy" title="Special:MyLanguage/Wikimedia services policy">Services policy</a><span style="display:none"><a href="/wiki/Wikimedia_services_policy" title="Wikimedia services policy"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Support_policy_for_PHP" title="Special:MyLanguage/Support policy for PHP">Support policy for PHP</a><span style="display:none"><a href="/wiki/Support_policy_for_PHP" title="Support policy for PHP"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Gerrit/Privilege_policy" title="Special:MyLanguage/Gerrit/Privilege policy">Gerrit/Privilege policy</a><span style="display:none"><a href="/wiki/Gerrit/Privilege_policy" title="Gerrit/Privilege policy"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Stable_interface_policy" title="Special:MyLanguage/Stable interface policy">Stable interface policy</a><span style="display:none"><a href="/wiki/Stable_interface_policy" title="Stable interface policy"> </a></span> <ul><li><a href="/wiki/Special:MyLanguage/Stable_interface_policy/Frontend" title="Special:MyLanguage/Stable interface policy/Frontend">Frontend</a><span style="display:none"><a href="/wiki/Stable_interface_policy/Frontend" title="Stable interface policy/Frontend"> </a></span></li></ul></li> <li><a href="/wiki/Special:MyLanguage/MediaWiki_database_policy" title="Special:MyLanguage/MediaWiki database policy">MediaWiki database policy</a><span style="display:none"><a href="/wiki/MediaWiki_database_policy" title="MediaWiki database policy"> </a></span></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">General guidelines</th><td class="navbox-list1 navbox-list navbox-even" style="width:100%;padding:0px"><div style="padding:0em 0.25em"> <ul><li><a href="/wiki/Special:MyLanguage/Security_for_developers" title="Special:MyLanguage/Security for developers">Security for developers</a><span style="display:none"><a href="/wiki/Security_for_developers" title="Security for developers"> </a></span></li> <li><a href="https://wikitech.wikimedia.org/wiki/Performance/Guides/Backend_performance_practices" class="extiw" title="wikitech:Performance/Guides/Backend performance practices">Performance guidelines</a></li> <li><a href="/wiki/Special:MyLanguage/Gerrit/Commit_message_guidelines" title="Special:MyLanguage/Gerrit/Commit message guidelines">Commit message guidelines</a><span style="display:none"><a href="/wiki/Gerrit/Commit_message_guidelines" title="Gerrit/Commit message guidelines"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Security_checklist_for_developers" title="Special:MyLanguage/Security checklist for developers">Security checklist for developers</a><span style="display:none"><a href="/wiki/Security_checklist_for_developers" title="Security checklist for developers"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Localisation" title="Special:MyLanguage/Localisation">Localisation</a><span style="display:none"><a href="/wiki/Localisation" title="Localisation"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Design/Living_style_guide" title="Special:MyLanguage/Design/Living style guide">Design style guide</a><span style="display:none"><a href="/wiki/Design/Living_style_guide" title="Design/Living style guide"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Documentation/Style_guide" title="Special:MyLanguage/Documentation/Style guide">Documentation/Style guide</a><span style="display:none"><a href="/wiki/Documentation/Style_guide" title="Documentation/Style guide"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Accessibility_guide_for_developers" title="Special:MyLanguage/Accessibility guide for developers">Accessibility guide for developers</a><span style="display:none"><a href="/wiki/Accessibility_guide_for_developers" title="Accessibility guide for developers"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Inclusive_language" title="Special:MyLanguage/Inclusive language">Inclusive language</a><span style="display:none"><a href="/wiki/Inclusive_language" title="Inclusive language"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Guidelines_for_a_healthy_code_review_culture" title="Special:MyLanguage/Guidelines for a healthy code review culture">Guidelines for a healthy code review culture</a><span style="display:none"><a href="/wiki/Guidelines_for_a_healthy_code_review_culture" title="Guidelines for a healthy code review culture"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Collaborative_programming" title="Special:MyLanguage/Collaborative programming">Collaborative programming</a><span style="display:none"><a href="/wiki/Collaborative_programming" title="Collaborative programming"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Best_practices_for_extensions" title="Special:MyLanguage/Best practices for extensions">Best practices for extensions</a><span style="display:none"><a href="/wiki/Best_practices_for_extensions" title="Best practices for extensions"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Pre-commit_checklist" title="Special:MyLanguage/Manual:Pre-commit checklist">Pre-commit checklist</a><span style="display:none"><a href="/wiki/Manual:Pre-commit_checklist" title="Manual:Pre-commit checklist"> </a></span></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Code conventions</th><td class="navbox-list1 navbox-list navbox-odd" style="width:100%;padding:0px"><div style="padding:0em 0.25em"> <ul><li><a href="/wiki/Special:MyLanguage/Manual:Coding_conventions#Code_structure" title="Special:MyLanguage/Manual:Coding conventions">All languages</a><span style="display:none"><a href="/wiki/Manual:Coding_conventions#Code_structure" title="Manual:Coding conventions"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Coding_conventions/PHP" title="Special:MyLanguage/Manual:Coding conventions/PHP">PHP</a><span style="display:none"><a href="/wiki/Manual:Coding_conventions/PHP" title="Manual:Coding conventions/PHP"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:PHP_unit_testing/Writing_unit_tests#Test_conventions" title="Special:MyLanguage/Manual:PHP unit testing/Writing unit tests">PHPUnit</a><span style="display:none"><a href="/wiki/Manual:PHP_unit_testing/Writing_unit_tests#Test_conventions" title="Manual:PHP unit testing/Writing unit tests"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Coding_conventions/JavaScript" title="Special:MyLanguage/Manual:Coding conventions/JavaScript">JavaScript</a><span style="display:none"><a href="/wiki/Manual:Coding_conventions/JavaScript" title="Manual:Coding conventions/JavaScript"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Coding_conventions/CSS" title="Special:MyLanguage/Manual:Coding conventions/CSS">CSS</a><span style="display:none"><a href="/wiki/Manual:Coding_conventions/CSS" title="Manual:Coding conventions/CSS"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Coding_conventions/Selenium" title="Special:MyLanguage/Manual:Coding conventions/Selenium">Selenium</a><span style="display:none"><a href="/wiki/Manual:Coding_conventions/Selenium" title="Manual:Coding conventions/Selenium"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Coding_conventions/Lua" title="Special:MyLanguage/Manual:Coding conventions/Lua">Lua</a><span style="display:none"><a href="/wiki/Manual:Coding_conventions/Lua" title="Manual:Coding conventions/Lua"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Coding_conventions/Python" title="Special:MyLanguage/Manual:Coding conventions/Python">Python</a><span style="display:none"><a href="/wiki/Manual:Coding_conventions/Python" title="Manual:Coding conventions/Python"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Coding_conventions/Java" title="Special:MyLanguage/Manual:Coding conventions/Java">Java</a><span style="display:none"><a href="/wiki/Manual:Coding_conventions/Java" title="Manual:Coding conventions/Java"> </a></span></li> <li><b><a href="/wiki/Special:MyLanguage/Manual:Coding_conventions/SVG" title="Special:MyLanguage/Manual:Coding conventions/SVG">SVG</a></b><span style="display:none"><a class="mw-selflink selflink"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Coding_conventions/Vue" title="Special:MyLanguage/Manual:Coding conventions/Vue">Vue</a><span style="display:none"><a href="/wiki/Manual:Coding_conventions/Vue" title="Manual:Coding conventions/Vue"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Manual:Coding_conventions/Database" title="Special:MyLanguage/Manual:Coding conventions/Database">Database schemas</a><span style="display:none"><a href="/wiki/Manual:Coding_conventions/Database" title="Manual:Coding conventions/Database"> </a></span></li> <li><a href="/wiki/Special:MyLanguage/Product_Analytics/Style_guide" title="Special:MyLanguage/Product Analytics/Style guide">Analytics (Python, R, SQL)</a><span style="display:none"><a href="/wiki/Product_Analytics/Style_guide" title="Product Analytics/Style guide"> </a></span></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">API client code</th><td class="navbox-list1 navbox-list navbox-even" style="width:100%;padding:0px"><div style="padding:0em 0.25em"> <ul><li><a href="/wiki/Special:MyLanguage/API:Client_code/Gold_standard" title="Special:MyLanguage/API:Client code/Gold standard">Standards for API client libraries</a><span style="display:none"><a href="/wiki/API:Client_code/Gold_standard" title="API:Client code/Gold standard"> </a></span></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Drafts</th><td class="navbox-list1 navbox-list navbox-odd" style="width:100%;padding:0px"><div style="padding:0em 0.25em"> <ul><li><i><a href="/wiki/Special:MyLanguage/Manual:Coding_conventions/Documentation" title="Special:MyLanguage/Manual:Coding conventions/Documentation">Code documentation</a><span style="display:none"><a href="/wiki/Manual:Coding_conventions/Documentation" title="Manual:Coding conventions/Documentation"> </a></span></i></li></ul> </div></td></tr></tbody></table></div> <!-- NewPP limit report Parsed by mw‐web.eqiad.main‐668977ddd9‐rh6d5 Cached time: 20241120231113 Cache expiry: 2592000 Reduced expiry: false Complications: [show‐toc] CPU time usage: 0.586 seconds Real time usage: 0.764 seconds Preprocessor visited node count: 4515/1000000 Post‐expand include size: 54398/2097152 bytes Template argument size: 9817/2097152 bytes Highest expansion depth: 16/100 Expensive parser function count: 52/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 46711/5000000 bytes Lua time usage: 0.168/10.000 seconds Lua memory usage: 1955097/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 489.299 1 -total 58.60% 286.726 1 Template:Conventions_navigation 56.96% 278.703 1 Template:Navbox 39.84% 194.941 36 Template:Ll 15.04% 73.606 72 Template:Translatable 14.22% 69.584 38 Template:Pagelang 13.33% 65.237 1 Template:Development_guideline 12.29% 60.156 1 Template:Mbox 6.80% 33.291 13 Template:TNTN 5.18% 25.339 2 Template:Ym --> <!-- Saved in parser cache with key mediawikiwiki:pcache:idhash:740452-0!canonical and timestamp 20241120231113 and revision id 6806061. Rendering was triggered because: page-view --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="https://www.mediawiki.org/w/index.php?title=Manual:Coding_conventions/SVG&amp;oldid=6806061">https://www.mediawiki.org/w/index.php?title=Manual:Coding_conventions/SVG&amp;oldid=6806061</a>"</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Special:Categories" title="Special:Categories">Categories</a>: <ul><li><a href="/wiki/Category:Development_guidelines" title="Category:Development guidelines">Development guidelines</a></li><li><a href="/wiki/Category:SVG" title="Category:SVG">SVG</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> This page was last edited on 21 October 2024, at 18:54.</li> <li id="footer-info-copyright">Text is available under the <a rel="nofollow" class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-ShareAlike License</a>; additional terms may apply. Text in <a class="external text" href="https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents">the Help: namespace</a> is available under the <a rel="nofollow" class="external text" href="https://creativecommons.org/publicdomain/zero/1.0/">Creative Commons CC0 License</a>. By using this site, you agree to the <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use">Terms of Use</a> and <a class="external text" href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy Policy</a>.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy policy</a></li> <li id="footer-places-about"><a href="/wiki/Project:About">About mediawiki.org</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Project:General_disclaimer">Disclaimers</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://www.mediawiki.org/wiki/Special:MyLanguage/Code_of_Conduct">Code of Conduct</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Developers</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/www.mediawiki.org">Statistics</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Cookie statement</a></li> <li id="footer-places-mobileview"><a href="//m.mediawiki.org/w/index.php?title=Manual:Coding_conventions/SVG&amp;mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobile view</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-f69cdc8f6-2c6ql","wgBackendResponseTime":116,"wgPageParseReport":{"limitreport":{"cputime":"0.586","walltime":"0.764","ppvisitednodes":{"value":4515,"limit":1000000},"postexpandincludesize":{"value":54398,"limit":2097152},"templateargumentsize":{"value":9817,"limit":2097152},"expansiondepth":{"value":16,"limit":100},"expensivefunctioncount":{"value":52,"limit":500},"unstrip-depth":{"value":0,"limit":20},"unstrip-size":{"value":46711,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 489.299 1 -total"," 58.60% 286.726 1 Template:Conventions_navigation"," 56.96% 278.703 1 Template:Navbox"," 39.84% 194.941 36 Template:Ll"," 15.04% 73.606 72 Template:Translatable"," 14.22% 69.584 38 Template:Pagelang"," 13.33% 65.237 1 Template:Development_guideline"," 12.29% 60.156 1 Template:Mbox"," 6.80% 33.291 13 Template:TNTN"," 5.18% 25.339 2 Template:Ym"]},"scribunto":{"limitreport-timeusage":{"value":"0.168","limit":"10.000"},"limitreport-memusage":{"value":1955097,"limit":52428800}},"cachereport":{"origin":"mw-web.eqiad.main-668977ddd9-rh6d5","timestamp":"20241120231113","ttl":2592000,"transientcontent":false}}});});</script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10