question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Buttons have incorrect sizes

See original GitHub issue

Describe the bug While documenting https://github.com/github/primer/issues/263, I realized that Primer React buttons have incorrect sizes when compared to Figma references and Primer CSS implementation, usually being 2px taller than expected.

This issue is probably due to borders being ignored in the calculation after specifying line-height + padding.

The total height of regular buttons should be 32px on the medium size, 28px on the small size, and 40px on the large size.

Related

https://github.com/github/primer/issues/41 (on “Using borders”)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
pksjcecommented, Nov 1, 2021

Also the icon sizes don’t correlate to the expected button sizes. So I’m assuming we don’t change the size of icons for buttons which have them.

https://github.com/primer/octicons/blob/main/docs/content/packages/react.mdx#sizes

0reactions
pksjcecommented, Jan 19, 2022

This is all fixed. Is the fix ideal? Maybe not. But the issue doesn’t exist any more with the new Button component

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incorrect CSS Button Height computing - Stack Overflow
I want these buttons to have a height of 32 pixels and get rid of the space in between the 2 buttons. I...
Read more >
Optimal Size and Spacing for Mobile Buttons - UX Movement
If they don't have an optimal size and spacing, it's no wonder users are missing their target or hitting the wrong button.
Read more >
QMessage box buttons size/others have incorrect width after ...
Once I do that, when I look at my buttons, they are all at "minimum" width size. QMessageBox "OK" button is like 20...
Read more >
Problem with button size - Jotform
I have a form on http://www.drmartinperez.com/index.htmlThe embedded code is: <script type="text/javascript" src="https://form.jotform.u...
Read more >
Button - dbc docs - Dash Bootstrap Components - Faculty AI
You can adjust the width of the block button can be achieved using grid column width classes. This button is made half-size using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found