Complete the code to export CSS properties for a selected element in Figma.
const cssProperties = figma.[1][0].exportCSS();
In Figma plugin API, figma.selection returns the currently selected nodes. To export CSS properties, you use the selected node from figma.selection.
Complete the code to get the CSS string from the exported properties.
const cssString = cssProperties.[1];toString which is a method, not a property.string or css which do not exist.The exportCSS() method returns an object with a cssText property containing the CSS string.
Fix the error in the code to correctly export CSS properties from the first selected node.
const cssProperties = figma.selection[1].exportCSS();first() which does not exist.figma.selection is an array. To access the first node, use bracket notation [0].
Fill both blanks to export CSS properties and log the CSS text to the console.
const cssProps = figma.selection[1].[2](); console.log(cssProps.cssText);
getCSS or toCSS.You must access the first selected node with [0] and call exportCSS() to get the CSS properties.
Fill all three blanks to export CSS properties, get the CSS text, and assign it to a variable.
const cssProps = figma.selection[1].[2](); const cssText = cssProps.[3];
toString instead of cssText.Access the first selected node with [0], call exportCSS() to get CSS properties, then get the CSS string from cssText.