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

0 comments on commit 055e303

Please sign in to comment.