figma / code-snippet-editor-plugin

Translate component variants, properties, and more into dynamic code snippets for your design system.
https://www.figma.com/community/plugin/1311777988952403297/code-snippet-editor
MIT License
126 stars 11 forks source link

X and Y values not visible in raw data #41

Closed mikeysouthwell closed 4 months ago

mikeysouthwell commented 4 months ago

Hi Jake,

How do I get the margin values from the node?

I can't see the X or Y values in the raw data.

For example I have a badge on my notification icon and I need to know it's distance from the edges of the frame for positioning purposes. As shown in the screenshot below, the X value is 23 and Y value is 4. With the Width and Height values of the ellipse being 22.

image

{ "node.name": "Ellipse", "node.type": "ELLIPSE", "css.width": "22px", "css.height": "22px", "css.flexShrink": "0", "css.fill": "var(--Red-Gradient, linear-gradient(180deg, #FB7474 7.29%, #F91F1F 100%))", "css.strokeWidth": "1px", "css.stroke": "var(--White, #FFF)" }

jake-figma commented 4 months ago

this is a limitation of the css plugin api output. will keep this in mind as we think about other node values to surface. this is complex because these values are relative to the parent layout mode.