Created
September 5, 2016 18:14
-
-
Save jneurock/850eec9ee1589f5a4cd81517b72a3017 to your computer and use it in GitHub Desktop.
For any path having no stroke value but having a fill value, set the stroke value to the fill value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var count = 0; | |
var i = 0; | |
var fill; | |
var path; | |
var paths = document.getElementsByTagName('path'); | |
var pathsLen = paths.length; | |
var stroke; | |
while (i < pathsLen) { | |
path = paths[i]; | |
fill = path.getAttribute('fill'); | |
stroke = path.getAttribute('stroke'); | |
if (fill && !stroke) { | |
console.info('Setting stroke color to fill color @path:' + i); | |
count++; | |
path.setAttribute('stroke', fill); | |
path.setAttribute('stroke-width', '1.25'); | |
} | |
i++; | |
} | |
console.info('Modified ' + count + ' of ' + pathsLen + ' paths'); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment