Skip to main content
Question

Button is not fitting the 8px grid

  • May 21, 2021
  • 1 reply
  • 1074 views

Harish_Shivaraman

Hi everyone, I’m trying to make a button to fit the 8px grid with auto layout. It’s not fitting the grid. However, I’ve seen a couple of other buttons from community files that perfectly fit the grid. What could be the reason for this? Here’s an example of the button slightly extending away from the grid. This is inspite of enabling “Snap to Pixel Grid”.

1 reply

Phil_Larsen
  • Active Member
  • 130 replies
  • May 22, 2021

You’ll want to make sure your line-height is a multiple of 8, and that the padding will make it equal a multiple of 8.

image

image

The width of the button will change if you have Hug-Contents selected. The only way I’m aware of to fix the width of the button on the 8pt grid is setting a fixed width of the auto layout.


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