Skip to main content
Question

Is it better to use Inside or Outside strokes?

  • November 18, 2022
  • 8 replies
  • 4229 views

X_Pea

Can you explain why you choose one over the other? My first thought is inside to follow your own grid and spacing rules perfectly, but when it goes into development, borders are generated outside of the element, right? So should your designs be created in anticipation of that?

8 replies

Nathan23
  • 2 replies
  • December 15, 2022

I’m also interested to hear how people decide inside vs outside.


AlicePackard

our team uses internal strokes for the same reason you mentioned: ensuring spacing isn’t influenced by a stroke.

CSS can be written this way too, so no need to compromise! Looks like developers could use the box-shadow property with inset preceding the pixel values of the shadow. An alternative would be using the outline property paired with outline-offset using a negative value.

You can see a live example of this on w3docs.


Guy_Lepage

Hmm… So your team decided to go against a W3 standard and add more work for developers. I thought less code is better code.


AlicePackard

Hey Guy, thanks for the critique, I think you’ve got a great point.

How does your team handle borders in Figma? I’d appreciate learning about your implementation.


Guy_Lepage

Well, we used borders but they are problematic. So, like every other team we have asked, it’s a HUGE issue. Long story short, it’s a mess of borders, inside, outside, etc. We’re not the only team to have this issue. But we have made the decision moving forward to use box-shadow. It’s just not even close to ideal.


AlicePackard

ah yeah, I get that. It’s aggravating to feel like you’re settling for something that feels brittle or more complicated than it ought to be.

Even though it’s not ideal, it’s helpful to know where you’ve landed, so thanks for that 🙏 I think others will be glad for the perspective too.


efiohw
  • 16 replies
  • February 14, 2024

They implement Dev Mode, but ignore this mismatch that is increasing the dev-Figma relationship and also the designers work just so much…


Julia57
  • Active Member
  • 41 replies
  • May 27, 2024

I’m running into the same thing with my dev team, especially with the promise of Code-Connect falling flat in the face of something as simple as a border…

My team is going to try doing stroke-inside in Figma, while the devs use box-sizing: border-box. Hope if works out. Has anyone else tried this? It seeeeems to be a good way to get around the issue of borders taking up space.

We wanted to use shadows at first, but the dual axis of widthxcolor made it a terrible idea to create SO MANY shadow styles just to mimic the borders.


Reply


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