Skip to main content
Solved

Can we export design into code exactly how we write the code?


Ragu

I would like to inquire about the possibility of exporting our website or SaaS application design from Figma into fully flexible HTML code from Figma.
Is such a feature available, and if so, could you kindly provide me with further information on how to accomplish this ?
P.s - I am aware that we can export html code but Can we export fully flexible code like how a developer write the code.

Best answer by Gleb

View original
This topic has been closed for replies.

3 replies

Gleb
  • Power Member
  • 4708 replies
  • Answer
  • April 10, 2023

  • 1 reply
  • August 12, 2023

Hey Gleb.
Design is fun but restore it is not
especially when I have to do it again and again.

I have tried to build a such tool but finally failed.

I can do it if auto-layout is applied to the design but I think I can not force people use auto-layout. Then I find it is really hard for me to transform layout from Figma to the way I code.

In order to solve this, I try to transform absolute layout to flex layout (auto-layout in web)
The basic algorithm is

1: get all elements from Figma api
2: get all bounding box with x, y width, height
3: try to seperate the box into different lines ( if elements overlap then same line)
4: for every line, if elemets overlap, find the minimum elements that should use absolute position
5: apply other attributes based on Figma api doc

I was wondering if it can solve the problem.
It can save my day!


ksn
Figmate
  • Community Support
  • 1672 replies
  • August 14, 2023

For anyone that sees this:

@yujie_wu created a new topic over here. If you have any suggestions, please post them over there 😃


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings