bernaferrari / FigmaToCode

Generate responsive pages and apps on HTML, Tailwind, Flutter and SwiftUI.
https://www.figma.com/community/plugin/842128343887142055
GNU General Public License v3.0
3.8k stars 303 forks source link

Can we use margin-bottom or margin-right to add item spacing of auto layout instead of add empty div? #29

Closed oney closed 3 years ago

oney commented 3 years ago

The code pointer is https://github.com/bernaferrari/FigmaToCode/blob/master/src/html/htmlMain.ts#L61 It's more a preference, but normally when we write html/css to add spacing, I believe we will use margin-bottom or margin-right rather than adding empty div.

bernaferrari commented 3 years ago

That's hard because there is no right way, css is terrible. The issue with setting margin-top and margin-bottom on each element is that it would probably get harder to understand, and there would be the issue where you can't reorder items by hand. When you see the empty divs you can just see what is going on.