Bogdan Chadkin
98c023bdb0
Drop node.class usages ( #1533 )
...
We are gonna remove everything outside of xast.
Here's dropped class prop.
2021-08-21 19:42:32 +03:00
Bogdan Chadkin
9b8f13e911
Add plugin types ( #1527 )
...
Covered following plugins
- addAttributesToSVGElement.js
- addClassesToSVGElement.js
- cleanupAttrs.js
- convertEllipseToCircle.js
- removeAttributesBySelector.js
- removeAttrs.js
- removeComments.js
- removeDesc.js
- removeDoctype.js
- removeElementsByAttr.js
- removeEmptyText.js
- removeMetadata.js
- removeRasterImages.js
- removeScriptElement.js
- removeStyleElement.js
- removeTitle.js
- removeXMLProcInst.js
2021-08-15 13:52:41 +03:00
Bogdan Chadkin
7ec255719c
Refactor adhoc plugins with visitor api ( #1526 )
...
- addAttributesToSVGElement
- addClassesToSVGElement
- removeAttributesBySelector
- removeAttrs
- removeElementsByAttr
2021-08-14 16:48:39 +03:00
Bogdan Chadkin
07f8d606e0
Implement preset-default plugin ( #1513 )
...
I saw complaints about `extendDefaultPlugins` api
- it cannot be used when svgo is installed globally
- it requires svgo to be installed when using svgo-loader or svgo-jsx
- it prevents using serializable config formats like json
In this diff I introduced the new plugin which is a bundle of all
default plugins.
```js
module.exports = {
plugins: [
'preset_default',
// or
{
name: 'preset_default',
floatPrecision: 4,
overrides: {
convertPathData: {
applyTransforms: false
}
}
}
]
}
```
2021-08-13 19:07:08 +03:00
Bogdan Chadkin
5314c12c99
Convert element children to xast
...
Ref https://github.com/syntax-tree/xast
Renamed content to children to match xast spec.
2021-03-11 12:29:13 +03:00
Bogdan Chadkin
00ec0f71fe
Format all plugins with prettier
2021-03-09 19:58:00 +03:00
GreLI
b51192cb7a
Fixed addClassesToSVGElement and added test
2017-10-25 22:25:57 +03:00
GreLI
055e303607
Tune plugins
2017-10-22 19:32:24 +03:00
Ricardo Tomasi
dd8e385695
addClassesToSVGElement: avoid repeated classnames
2016-04-05 19:23:49 +02:00
GreLI
a62176e762
Clarify need of parameters in addClassesToSVGElement. Resolves #479
2016-03-08 18:29:27 +03:00
GreLI
a7f62d8984
Formatting
2015-06-21 19:13:41 +03:00
Yoshiya Hinosawa
3f8e6fd15c
Fix lint
2015-06-12 00:25:32 +09:00
Yoshiya Hinosawa
8e6b365c40
Add --show-plugins option
2015-06-07 19:35:49 +09:00
April Arcus
8fa362270b
disable add css classes plugin by default
2015-04-30 18:10:47 -07:00
April Arcus
41abc27396
new plugin: add classes to SVG element
2015-04-29 09:44:37 -07:00