Also, it's further better if not inserting <div style="width: --px"></div> empty div between real items when primaryAxisAlignItems = SPACE_BETWEEN because flexbox will handle that.
However, space-between still causes a problem for one single item in parent div. See this.
I don't like margin: 0 auto; solution.
One solution may be if there is only 1 item in the parent div, use center rather than space-between.(but it doesn't work for dynamic children)
Please let me know if you need examples to demonstrate this.
Thanks a lot for this project!
https://github.com/bernaferrari/FigmaToCode/blob/ae47851096afafbd1c21bab34149f6dbdad7b2f8/src/html/htmlMain.ts#L244 This gives
justify-content: justify-between;
, but there is nojustify-between
I think.primaryAlign = "space-between";
should fix it.Also, it's further better if not inserting
<div style="width: --px"></div>
empty div between real items whenprimaryAxisAlignItems = SPACE_BETWEEN
because flexbox will handle that.However,
space-between
still causes a problem for one single item in parent div. See this. I don't likemargin: 0 auto;
solution. One solution may be if there is only 1 item in the parent div, usecenter
rather thanspace-between
.(but it doesn't work for dynamic children)Please let me know if you need examples to demonstrate this. Thanks a lot for this project!