You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,14 @@ If you want your SVG assets uncompressed, you can temporarily disable the Plugin
19
19
20
20
If for some reason you’re not happy with the default settings we’ve chosen, you can select **Plugins › SVGO Compressor › About SVGO Compressor** and then click the **Edit SVGO Settings…** button. You default editor will open the `svgo.json` file, where you’ll be able to tweak the settings.
21
21
22
-
## SVGO Plugins: what they do
22
+
### Top level settings
23
+
24
+
-`pretty`: Make SVG pretty printed
25
+
-`indent`: Indent number when pretty printing SVGs
26
+
-`multipass`: Run the optimization 10 times
27
+
-`floatPrecision`: The precision of the numbers to use in all the plugins
Copy file name to clipboardExpand all lines: src/defaultConfig.js
+46-68Lines changed: 46 additions & 68 deletions
Original file line number
Diff line number
Diff line change
@@ -5,49 +5,7 @@
5
5
// So, for every SVGO Plugin you want to use, you'll have to add an object to svgoJSON.plugins,
6
6
// with a 'name' key and a 'params' key (optional, only needed if you want to change any of the default params for a plugin)
7
7
//
8
-
// This is the list of SVGO Plugins available as of 2016-05-26:
9
-
// TODO: keep this list updated automatically
10
-
//
11
-
// - addAttributesToSVGElement - adds attributes to an outer <svg> element
12
-
// - addClassesToSVGElement - add classnames to an outer <svg> element
13
-
// - cleanupAttrs - cleanup attributes from newlines, trailing and repeating spaces
14
-
// - cleanUpEnableBackground - remove or cleanup enable-background attribute when possible
15
-
// - cleanupIDs - remove unused and minify used IDs
16
-
// - cleanupListOfValues - round numeric values in attributes that take a list of numbers, like viewBox or enableBackground
17
-
// - cleanupNumericValues - round numeric values to the fixed precision, remove default 'px' units
18
-
// - collapseGroups - collapse useless groups
19
-
// - convertColors - convert colors (from rgb() to #rrggbb, from #rrggbb to #rgb)
20
-
// - convertPathData - convert Path data to relative or absolute whichever is shorter, convert one segment to another, trim useless delimiters, smart rounding and much more
21
-
// - convertShapeToPath - convert some basic shapes to path
22
-
// - convertStyleToAttrs - convert styles into attributes
23
-
// - convertTransform - collapse multiple transforms into one, convert matrices to the short aliases and much more
24
-
// - mergePaths - merge multiple Paths into one
25
-
// - minifyStyles - minify <style> elements content with CSSO
26
-
// - moveElemsAttrsToGroup - move elements attributes to the existing group wrapper
27
-
// - moveGroupAttrsToElems - move some group attributes to the content elements
28
-
// - removeAttrs - remove attributes by pattern
29
-
// - removeComments - remove comments
30
-
// - removeDesc - remove <desc> (only non-meaningful by default)
31
-
// - removeDimensions - remove width/height attributes if viewBox is present
32
-
// - removeDoctype - remove doctype declaration
33
-
// - removeEditorsNSData - remove editors namespaces, elements and attributes
34
-
// - removeEmptyAttrs - remove empty attributes
35
-
// - removeEmptyContainers - remove empty Container elements
// - removeUselessDefs - remove elements of <defs> without id
46
-
// - removeUselessStrokeAndFill - remove useless stroke and fill attrs
47
-
// - removeViewBox - remove viewBox attribute when possible
48
-
// - removeXMLProcInst - remove XML processing instructions
49
-
// - sortAttrs - sort element attributes for epic readability
50
-
// - transformsWithOnePath - apply transforms, crop by real width, center vertical alignment and resize SVG with one Path inside
8
+
// This is the list of SVGO Plugins available taken from https://github.com/svg/svgo/blob/master/.svgo.yml. The order is important!s
51
9
//
52
10
// These are some sane defaults we've found to work reasonably well, compressing your SVG without
53
11
// altering the shapes or the look. Your milleage may vary, so feel free to tweak these…
@@ -56,31 +14,51 @@ module.exports = {
56
14
"comment": "This is the settings file for the SVGO Compressor Plugin. For more info, please check <https://github.com/BohemianCoding/svgo-compressor>",
detail: "This Plugin uses SVGO to compress SVG assets exported from Sketch.\n\nIt works automatically whenever you export to SVG, so you don’t need to do anything special. Just work on your design as always, and enjoy smaller & cleaner SVG files.\n\nIf for some reason you’re not happy with the default options, you can edit the svgo.json file in the Application Support folder for Sketch.\n"
0 commit comments