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

Inconsistent component default/spacer padding #25057

Closed
bbugh opened this issue Dec 22, 2017 · 3 comments · Fixed by #30564
Closed

Inconsistent component default/spacer padding #25057

bbugh opened this issue Dec 22, 2017 · 3 comments · Fixed by #30564

Comments

@bbugh
Copy link

bbugh commented Dec 22, 2017

We've been running into consistency issues using Bootstrap 4beta2's default spacing.

Most of the components ($table-cell-padding, $card-spacer-y, $alert-padding-y, etc.) use a padding: .75rem. However, the $spacers don't include that value. It's not possible to use a built in padding class to match the components, which is very weird.

For example, putting a table into a card:

<div class="card">
  <h4 class="card-header">My Header</h4>
  <table class="table">
    <tr> 
      <td>Label</td>
      <td>Value</td>
    </tr>
  </table>
</div>

Results in HTML that looks like this:

image

The .card-header class is using a hard-coded 1.25rem padding (from $card-spacer-x), while the table cell is using hard-coded .75rem (from $table-cell-padding).

I would expect to be able to have some kind of pl-? (left) or pt-? (top) class that matches these components default, since it's in so many places. However, there aren't any Bootstrap-defined classes that you can use to get that .card-header padding to match all of the default component paddings. I realize we can make our own class, but it seems like an oversight and an actual issue to note.

@gijsbotje
Copy link
Contributor

i think card-body should be around the table, then at least the border of the table lines up

@aethelwulffe
Copy link

Anyone reconsidered #3737 for V4 (or better yet a 3x patch)?

@MartijnCuppens
Copy link
Member

We'll probably be syncing the paddings in v5

mdo added a commit that referenced this issue Apr 11, 2020
- Updates horizontal padding across alerts, cards, dropdowns, list groups, and modals to be our default  of 1rem
- Reassigns some variables to improve ease of customization
- Restyles the breadcrumb a smidge to make the background lighter for improved contrast and a little less vertical padding

Fixes #25057 for v5.
@mdo mdo added the has-pr label Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants