Is it possible to connect with layout properties?
Hello,
Is it possible to connect with layout properties? If so, is it also possible to get variable names?
Hey @Tiberriver256, this isn't currently possible. It would be interesting to know a bit more about your use case, i.e. what do you want to access and why is it not a component prop? We're definitely interested to support as many use cases as possible.
Thanks @tomduncalf-figma!
Our designer uses layout properties and consistent variables quite a bit. We have props laid out on our React components that match the design variables similar to how React Spectrum uses styles and would like to map those values to his.
So for this screenshot:
I would want to see a code connect snippet that looked something like:
<MyComponent
padding-top="3"
padding-right="5"
padding-bottom="3"
padding-left="5"
radius="m" />
The idea being that we could copy the code-snippet from figma and it would look identical to the design.
@tomduncalf-figma we have a similar need. For example, there's a divider component which has an "orientation" property in code that can be "horizontal" or "vertical". But we don't want to add this as a property in Figma because that would double the number of variants. So designers just rotate the divider or transpose its dimensions. It would be convenient to have access to the rotation/width/height attributes to calculate the orientation.
We have a similar use case, but for Style properties actually. We have a ColorIcon component that can be any color, and designers just set the fill color directly on Style for this.