Skip to main content
Question

Trying to build components based off of CSS box model styling


I am trying to build a component library in Figma based off of some CSS and HTML code we are using from a new bootstrap theme. We are customizing the theme to update all of our styling across each page of our SaaS product. When I use the developer tool to inspect elements on the page, some of these specify a value for a margin. I haven’t been able to figure out how to easily replicate margins in Figma, especially when multiple layers of containers call for specific margins. The tool for creating vertical or horizontal gaps can only do one or the other, what do I do when I need a margin for both the top/bottom and the right or left sides?

2 replies

Nate_G
  • Power Member
  • 175 replies
  • October 17, 2023

You could try using auto-layouts within auto-layouts to get close to what you are looking for.


Maria_Soliman
  • New Participant
  • 6 replies
  • February 3, 2025

Would love proper box model support in Figma! Would make handoff so much better!

I looked for a feature suggestion and the only related thing I found was a request to support negative margins: 

 


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