Created
February 3, 2020 21:41
-
-
Save alexjlockwood/f6ca43a552bbb58fa129cc298f807859 to your computer and use it in GitHub Desktop.
Prints nodes that have fill/stroke colors that aren't linked to a style.
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
figma.root.children | |
.flatMap(pageNode => pageNode.findAll(n => true)) | |
.forEach(node => { | |
if ('fills' in node && 'fillStyleId' in node) { | |
if (node.fills !== figma.mixed && node.fills.length > 0 && node.fillStyleId !== '') { | |
print(`${node.name}'s fill color is not linked to a style`); | |
} | |
} | |
if ('strokes' in node && 'strokeStyleId' in node) { | |
if (node.strokes.length > 0 && node.strokeStyleId !== '') { | |
print(`${node.name}'s stroke color is not linked to a style`); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment