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
{ | |
"name": "flare", | |
"children": [ | |
{ | |
"name": "analytics", | |
"children": [ | |
{ | |
"name": "cluster", | |
"children": [ | |
{ "name": "AgglomerativeCluster", "size": 3938 }, |
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
{ | |
"comment": "This is the settings file for the SVGO Compressor Plugin. For more info, please check <https://github.com/BohemianCoding/svgo-compressor>", | |
"pretty": true, | |
"indent": 2, | |
"floatPrecision": 3, | |
"plugins": [ | |
{ | |
"name": "removeDoctype", | |
"enabled": true | |
}, |
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
{ | |
"comment": "This is the settings file for the SVGO Compressor Plugin. For more info, please check <https://github.com/BohemianCoding/svgo-compressor>", | |
"pretty": true, | |
"indent": 2, | |
"floatPrecision": 3, | |
"plugins": [ | |
{ | |
"name": "removeDoctype", | |
"enabled": true | |
}, |
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
{"v":"5.2.1","fr":60,"ip":0,"op":66,"w":1000,"h":1000,"nm":"Lyft_AmpPaired_Streak_003","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 4","parent":10,"td":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[1000,1000],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.482352942228,0.1254902035,0.976470589638,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":66," |
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
// | |
// The Scripter environment. | |
// | |
// What's declared in there is available to scripts in their global namespace. | |
// | |
// symbolic type aliases | |
type int = number | |
type float = number | |
type byte = number |
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
// Get the list of color styles in the current Figma file. | |
const colorStyles = figma.getLocalPaintStyles(); | |
const updatedColorStyles = colorStyles.filter(style => { | |
const { paints } = style; | |
if (paints.length !== 1) { | |
// Skip styles containing multiple colors. | |
return false; | |
} | |
const [paint] = paints; |
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
const components = figma.root.children.flatMap(pageNode => { | |
return pageNode.findAll(node => node.type === 'COMPONENT'); | |
}); | |
const styles = [ | |
...figma.getLocalEffectStyles(), | |
...figma.getLocalGridStyles(), | |
...figma.getLocalPaintStyles(), | |
...figma.getLocalTextStyles(), | |
]; |
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
// Create a list of all component nodes in the Figma file. | |
const componentNodes = figma.root.children.flatMap(pageNode => { | |
return pageNode.findAll(node => node.type === 'COMPONENT'); | |
}) as readonly ComponentNode[]; | |
// Create a list of component nodes that have more than one child node. | |
const unflattenedComponentNodes = componentNodes.filter(componentNode => { | |
const childrenNodes = componentNode.findAll(() => true); | |
return childrenNodes.length > 1; | |
}); |
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
if (figma.currentPage.selection.length !== 1) { | |
figma.notify("🚫 Select a component"); | |
return; | |
} | |
const [componentNode] = figma.currentPage.selection; | |
if (componentNode.type !== "COMPONENT") { | |
figma.notify("🚫 Select a component"); | |
return; | |
} |
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 !== '') { |