Some goodness from pull-requests.
Fixed extra blank lines when processing many files (by @panczarny).
Added --recursive
option to process folders recursevely with option -f
(by @dartess).
Added removeAttributesBySelector
plugin to remove elements matching a css selector (by @bmease).
Added removeOffCanvasPaths
plugin to remove elements outside of the viewbox (by @JoshyPHP).
removeAttrs
plugin: added preserveCurrentColor
color (by @roblevintennis) and 3rd optional filter for a value (by @Herman-Freund).
Added reusePaths
plugin to replace duplicated elements with link (by @jhowcrof).
Added support of comma-separated plugins list in --disable
and --enable
options (by @jmwebservices).
Added option to preserve IDs based on prefix in cleanupIDs
plugin (by @bkotzz).
* Replaced colors
dependency with chalk
(by @xPaw).
SVGO.optimize()
when ‘info’ is absent.cleanupListOfValues
plugin.collapseGroups
plugin removing property with a child having inherit
value.version
attribute value is not more being rounded.clone
method with respect to the introduced CSS classes.vector-effect="non-scaling-stroke"
(by @alexjlockwood).collapseGroups
plugin if child have a filter (by @stristr).viewBox
separators parsing.removeNonInheritableGroupAttrs
plugin to work as intended.stroke-linecap
.removeUnknownsAndDefaults
plugin removing attributes from elements with id
.collapseGroups
plugin affecting <switch>
and its subgroups.convertTransform
plugin converting to rotate()
with wrong sign in some case.cleanupListOfValues
plugin not preserving non-numeric values.!important
being passed to attributes in convertStyleToAttrs
plugin.keepImportant
to convertStyleToAttrs
plugin to preserve styles with !important
.removeHiddenElems
plugin now also removes elements with visibility="hidden"
attribute (by @mikolaj92).forceAbsolutePath
option to convertPathData
plugin to always use absolute coordinates (by @cool).keepRoleAttr
for removeUnknownsAndDefaults
plugin to preserve role-
attributes (by @himedlooff).xmlns
order option in sortAttrs
plugin (by @hellatan).prefixIds
plugin to pass prefix as false or as a function that returns false (by @vzaidman).prefixIds
plugin now adds prefix to every class (by @vzaidman).removeViewBox
plugin to check for zero start coordinates.inlineStyles
plugin.<foreignObject/>
.svgo *.svg
syntax.SVGO.optimize()
now returns Promise
.datauri
option to JS API.href
attribute.cleanupIDs
now don't removes IDs if an image consists only of defs
.inlineStyles
for converting styles from <style>
element to attributes if possible (by @strarsis).cleanupNumericValues
now rounds values in viewBox
(by @caub).removeScriptElement
(disabled by default) to align with removeStyleElement
(by @pklingem).minifyStyles
now removes styles based on usage with controlling options (by @lahmatiy).except
in cleanupIDs
to keep IDs (by @Velenir).force
in cleanupIDs
to work even if SVG contains style
or script
elements (by @Velenir).scale
parameters (by @JoshyPHP).removeUselessStrokeAndFill
to check for style
or script
elements per file (by @caub).keepAriaAttrs
in removeUnknownsAndDefaults
(by @davidtheclark).cleanupIDs
to account animation syntax (by @caub).#ff0000
now converts to red
as well as #f00
(by @davidleston).removeAttrs
now can be changed per elemSeparator
option (by @mikestreety).addAttributesToSVGElement
now can add values to attributes.currentColor
match conditions (string, rx, bool) (by @AlimovSV)<animate>
in <stop>
.removeUnknownsAndDefaults
.addAttributesToSVGElement
to the default config to allow using it with --enable
option.removeElementsByAttr
(by IDs or classes) by @elidupuis,
addAttributesToSVGElement
by @gjjones,
removeXMLNS
(for SVG inlining) by @ricardobeat.collapseGroups
.cleanupIDs
.sortAttrs
by @darktrojan.addClassesToSVGElement
no more repeats classes (by @ricardobeat).<foreignObject>
as well thus fixing bug “Namespace prefix … is not defined“ after applying SVGO.moveGroupAttrsToElems
not to move attributes to g
content if it's referenced (has an id
).collapseGroups
now don't collapse a group if it has an animated attribute (SMIL).removeUnknownsAndDefaults
).--indent
option to style pretty-printed SVG. (e.g. --indent 2
) (by @scurker).currentColor
param to convertColors
plugin for converting values like fill
and stroke
to currentColor
(by @scurker).xlink:href
references are now being checked by local name href
, thus correctly working with another namespace prefix.id
removing with disabled plugins/convertStyleToAttrs.js
.--multipass
option.plugins/moveElemsAttrsToGroup.js
).[1, 0, 0, -1, 0, 0]
(scale(1 -1)
).id
and without stroke-width
aren't being transformed now since stroke-width
may be applied later.--quiet
to suppress output (by @phihag).lib-cov
folder from the package, which was erroneously included before.<style>
elements with CDATA
content or without content at all.<style>
elments content with CSSO by @strarsis (svgo still doesn't understand its content)precision
cli-option and full
config.clip-path
.useShortTags
by @bradbarrow. Now svgo can produce correct non-selfclosing tags (useful in HTML in old browsers).url()
.--show-plugins
displaying list of plugins.width
and height
if there is viewBox
) and “removeAttrsPlugin” (by @bennyschudel).transformPrecision
option for better image quality (defaults to 5) in “convertTransform” and “convertPathData” (for the purpose of applying transformations) plugins.translate
, rotate
, scale
.arcto
command) are now correctly being transformed into another arcs without being converting to Bezier curves.rotate()
with optional parameters.<desc>
(by @dennari).clone()
method to JSAPI (by @jakearchibald)<defs>
and similar non-rendering elements without an id
and thus cannot be used--multipass
command line option (by @dfilatov)</svg>
tag<text>
data-*
attributes are now preserved in removeUnknownsAndDefaults<foreignObject>
<path d="z"/>
vector-effect="non-scaling-stroke"
id
on root <svg>
tag in removeUnknownsAndDefaults since it's already being done in cleanupIDs--multipass
command line option which repeatedly applies optimizations like collapsing groups (by @dfilatov)utilizeAbsolute
to false
.--output
option now can be a folder along with --folder
, thanks to @mako-taco.prefix
option in case you want to combine multiple svg later (by @DanielMazurkiewicz).lcov.info
to npmignorejs-yaml
version to suppress deprecation warning in stdoutresult
attribute from filter primitives (fix #122).jshintrc
: JSHint 2.0cropAndCenterAlongPath
)full: true
--config
node.extend
→ whet.extend
.gitignore
README.ru.md
: стилизация русского языка, улучшение языковых конструкций, правка ошибок (close #91)-1.816-9.278.682-13.604
parsing error (fix #85)translate(10, 0)
eq translate(10)
, but not translate(10, 10)
eq translate(10)
(fix #83).gitignore
.gitignore
isElem()
API.travis.yml
: check all branchesz + m
(fix #69)matrixToTransform()
(fix #68)svgo-grunt
and svgo-osx-folder-action
mocha-as-promised
plug in node 0.6README.ru.md
docs/how-it-works/ru.md
package.json
v0.1.x
and v0.2.x
milestoneslogo.svg
.travis.yml
: build only master branch'use strict'
.jshintignore
--input
and --output
(close #28)./lib/svgo/
config.json
to .svgo.yml
M
even if it's 0,0
cleanupAttrs
should be before convertStyleToAttrs
(fix #44)*eachAttr()
optional context param--test
(close #38).editorconfig
: 2 spaces for YAMLAdd the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.