Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add padding to badges #31132

Merged
merged 9 commits into from
Aug 2, 2020
Merged

Add padding to badges #31132

merged 9 commits into from
Aug 2, 2020

Conversation

patrickhlauke
Copy link
Member

The current badges are very tightly padded, and because the top and bottom padding are the same, and aligned to the baseline, this makes badges with descenders (e.g. the "g" in "Danger") look uncomfortably close to the bottom. Adding more ample padding masks this a bit.
An alternative would be to have separate top and bottom padding, with the bottom one slightly larger than the top - but conversely, that then makes badges that contain no text with descenders, and particularly badges that contain all uppercase characters, look too bottom-heavy.
Also adding some left/right extra padding, as currently the pill badges look uncomfortably tight on the sides due to the rounding.

The current badges are very tightly padded, and because the top and bottom padding are the same, and aligned to the baseline, this makes badges with descenders (e.g. the "g" in "Danger") look uncomfortably close to the bottom. Adding more ample padding masks this a bit.
An alternative would be to have separate top and bottom padding, with the bottom one slightly larger than the top - but conversely, that then makes badges that contain no text with descenders, and particularly badges that contain all uppercase characters, look too bottom-heavy.
Also adding some left/right extra padding, as currently the pill badges look uncomfortably tight on the sides due to the rounding.
@patrickhlauke
Copy link
Member Author

Current badges:

badges-current

badges-current-detail

With more padding:

badges-more-padded

badges-more-padded-detail

@alecpl
Copy link
Contributor

alecpl commented Jun 21, 2020

I don't see that problem on version 4.4 in Firefox and Chromium on Linux.

@mdo
Copy link
Member

mdo commented Jun 21, 2020

This is largely due to Segoe on Windows. It sits much lower than Arial, Helvetica, San Francisco, and others. Wondering if there’s any other great fonts that are closer we could look into? Or adjustments to make without compromising SF/Apple devices.

@mdo
Copy link
Member

mdo commented Jun 25, 2020

And, actually, revisiting this, the padding is pretty tight currently at the "normal"/body text size.

@mdo
Copy link
Member

mdo commented Jul 20, 2020

I think we ought to leave these as-is in v4 and make the change v5-only. I'd also push for the sizing to be smaller than what's suggested here. Bumping a bit to .3em and .65 feels pretty good still, but .5em vertical padding is too much IMO.

split the difference... `.5em` is a bit heavy-handed, `.3em` seems  to make little difference... `.35em` perhaps?
@patrickhlauke
Copy link
Member Author

tweaked to .35em (as .3em still felt a shade too unbalanced on Windows) @mdo

@patrickhlauke
Copy link
Member Author

ping @twbs/css-review / @mdo

Copy link
Member

@mdo mdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a note to the Migration guide about the change, but otherwise looks good to me. Worst case we adjust further during alpha/beta period.

Edit: Migration notes can happen here or in https://github.com/twbs/bootstrap/tree/migration-updates fwiw. I have a PR to open for that.

@patrickhlauke
Copy link
Member Author

Edit: Migration notes can happen here or in ...

@mdo oops, missed that (was just going by email notifications). anyway, added a note to migration docs here. Assume then that you don't want to backport to v4 and just leave as a v5 change?

@XhmikosR XhmikosR merged commit a21f605 into main Aug 2, 2020
@XhmikosR XhmikosR deleted the v5-badge-padding branch August 2, 2020 13:28
olsza pushed a commit to olsza/bootstrap that referenced this pull request Oct 3, 2020
* Add padding to badges

The current badges are very tightly padded, and because the top and bottom padding are the same, and aligned to the baseline, this makes badges with descenders (e.g. the "g" in "Danger") look uncomfortably close to the bottom. Adding more ample padding masks this a bit.
An alternative would be to have separate top and bottom padding, with the bottom one slightly larger than the top - but conversely, that then makes badges that contain no text with descenders, and particularly badges that contain all uppercase characters, look too bottom-heavy.
Also adding some left/right extra padding, as currently the pill badges look uncomfortably tight on the sides due to the rounding.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants