Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save doc22940/17ac3c27851b3bab0b95210e00b0f249 to your computer and use it in GitHub Desktop.
Save doc22940/17ac3c27851b3bab0b95210e00b0f249 to your computer and use it in GitHub Desktop.
Prints nodes that have fill/stroke colors that aren't linked to a style.
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