code-connect icon indicating copy to clipboard operation
code-connect copied to clipboard

Will Layout Be Supported?

Open otsukatatsuya opened this issue 1 year ago • 5 comments

Hello. In Code Connect, componentized parts are converted into code, but will layout be supported in the future?

For example, consider a design in Material Web. There is a Dialog component, and within it are Button and Icon components as children.

スクリーンショット 2024-12-04 15 17 15

While information about these Buttons and Icons can be referenced via figma.children, there doesn’t seem to be a way to retrieve layout details (such as alignment, spacing, etc.) at present. Without this, a significant amount of adjustments would be required for the code displayed in Figma.

スクリーンショット 2024-12-04 15 17 11

Ultimately, I’d like to achieve something where selecting an entire page in Figma generates a complete corresponding code.

For instance, it would be great if, when publishing in Figma, Code Connect could internally read the layout and automatically supplement layout-related styles, such as <div class="flex flex-col gap-8">.

otsukatatsuya avatar Dec 04 '24 06:12 otsukatatsuya

Thank you for the input. We have nothing planned right now, but we'll discuss it internally

rrabherufigma avatar Dec 04 '24 20:12 rrabherufigma

@rrabherufigma Thanks!

otsukatatsuya avatar Dec 05 '24 01:12 otsukatatsuya

For the sake of discussion, It would be really cool to create standardized and componentize frames that could be setup to use variables and code connect so that frames are consistently used across designs.

Larsthedesigner avatar Dec 05 '24 21:12 Larsthedesigner

@Larsthedesigner

Thank you.

standardized and componentize frames that could be setup to use variables and code connect

Are they like MUI's Stack or Box, for example? https://mui.com/material-ui/react-stack/

otsukatatsuya avatar Dec 06 '24 00:12 otsukatatsuya

@otsukatatsuya That would be my idea. Figma's auto-layout is basically like building in flex. Composite flex properties could be componentized to become things like stack, box, with standard justify content, padding, gap, etc.

Larsthedesigner avatar Apr 30 '25 15:04 Larsthedesigner