Skip to content

Commit

Permalink
Fix wrapping card decks (#22289)
Browse files Browse the repository at this point in the history
fixes #22007 and fixes #21976 by changing margin strategy for card deck gutters
  • Loading branch information
mdo authored Mar 28, 2017
1 parent fe3acc0 commit bebdbe4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions scss/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,15 @@
.card-deck {
display: flex;
flex-flow: row wrap;
margin-right: -$card-deck-margin;
margin-left: -$card-deck-margin;

.card {
display: flex;
flex: 1 0 0;
flex-direction: column;

// Selectively apply horizontal margins to cards to avoid doing the
// negative margin dance like our grid. This differs from the grid
// due to the use of margins as gutters instead of padding.
&:not(:first-child) { margin-left: $card-deck-margin; }
&:not(:last-child) { margin-right: $card-deck-margin; }
margin-right: $card-deck-margin;
margin-left: $card-deck-margin;
}
}
}
Expand Down

0 comments on commit bebdbe4

Please sign in to comment.