Skip to content

Commit

Permalink
Tune plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
GreLI committed Oct 22, 2017
1 parent f8234fd commit 055e303
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 355 deletions.
1 change: 0 additions & 1 deletion .svgo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ plugins:
- removeEmptyContainers
- mergePaths
- removeUnusedNS
- transformsWithOnePath
- sortAttrs
- removeTitle
- removeDesc
Expand Down
22 changes: 11 additions & 11 deletions plugins/addAttributesToSVGElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ exports.active = false;

exports.description = 'adds attributes to an outer <svg> element';

var ENOCLS = 'Error in plugin "addAttributesToSVGElement": absent parameters.\n\
It should have a list of classes in "attributes" or one "attribute".\n\
Config example:\n\n\
\
plugins:\n\
- addAttributesToSVGElement:\n\
attribute: "mySvg"\n\n\
\
plugins:\n\
- addAttributesToSVGElement:\n\
attributes: ["mySvg", "size-big"]\n';
var ENOCLS = `Error in plugin "addAttributesToSVGElement": absent parameters.
It should have a list of classes in "attributes" or one "attribute".
Config example:
plugins:
- addAttributesToSVGElement:
attribute: "mySvg"
plugins:
- addAttributesToSVGElement:
attributes: ["mySvg", "size-big"]`;

/**
* Add attributes to an outer <svg> element. Example config:
Expand Down
23 changes: 12 additions & 11 deletions plugins/addClassesToSVGElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ exports.active = false;

exports.description = 'adds classnames to an outer <svg> element';

var ENOCLS = 'Error in plugin "addClassesToSVGElement": absent parameters.\n\
It should have a list of classes in "classNames" or one "className".\n\
Config example:\n\n\
\
plugins:\n\
- addClassesToSVGElement:\n\
className: "mySvg"\n\n\
\
plugins:\n\
- addClassesToSVGElement:\n\
classNames: ["mySvg", "size-big"]\n';
var ENOCLS = `Error in plugin "addClassesToSVGElement": absent parameters.
It should have a list of classes in "classNames" or one "className".
Config example:
plugins:
- addClassesToSVGElement:
className: "mySvg"
plugins:
- addClassesToSVGElement:
classNames: ["mySvg", "size-big"]
`;

/**
* Add classnames to an outer <svg> element. Example config:
Expand Down
2 changes: 1 addition & 1 deletion plugins/removeDesc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports.type = 'perItem';
exports.active = true;

exports.params = {
removeAny: false
removeAny: true
};

exports.description = 'removes <desc> (only non-meaningful by default)';
Expand Down
5 changes: 2 additions & 3 deletions plugins/removeTitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

exports.type = 'perItem';

exports.active = false;
exports.active = true;

exports.description = 'removes <title> (disabled by default)';
exports.description = 'removes <title>';

/**
* Remove <title>.
* Disabled by default cause it may be used for accessibility.
*
* https://developer.mozilla.org/en-US/docs/Web/SVG/Element/title
*
Expand Down
4 changes: 2 additions & 2 deletions plugins/removeViewBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

exports.type = 'perItem';

exports.active = false;
exports.active = true;

exports.description = 'removes viewBox attribute when possible (disabled by default)';
exports.description = 'removes viewBox attribute when possible';

var viewBoxElems = ['svg', 'pattern', 'symbol'];

Expand Down
Loading

3 comments on commit 055e303

@alexjlockwood
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Lev, do you mind updating the changelog to mention that the transformsWithOnePath plugin has been removed? The README.md still references it as well.

@GreLI
Copy link
Member Author

@GreLI GreLI commented on 055e303 Nov 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, forgot to remove.

@wmertens
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing the viewbox by default is a breaking change… could you also mention that in the Changelog?

Please sign in to comment.