mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-25 04:12:55 +01:00
change card deck margin strategy
- Instead of negative left/right margins, we selectively apply margins to the cards as needed. This way the first and last child never receive a left and right margin (respectively), so we don't need to negative indent those at the .card-deck level. - Drops the margin-bottom override on the .card because there's no more default margin there. - Drop the margin-bottom from the .card-deck to match our lack of margins on the card. This and the previous commit fixes #19883.
This commit is contained in:
parent
b3d8426ffe
commit
040acd30db
@ -195,17 +195,17 @@
|
|||||||
.card-deck {
|
.card-deck {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: row wrap;
|
flex-flow: row wrap;
|
||||||
margin-right: -$card-deck-margin;
|
|
||||||
margin-bottom: $card-spacer-y; // Margin balancing
|
|
||||||
margin-left: -$card-deck-margin;
|
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex: 1 0 0;
|
flex: 1 0 0;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
margin-right: $card-deck-margin;
|
|
||||||
margin-bottom: 0; // Margin balancing
|
// Selectively apply horizontal margins to cards to avoid doing the
|
||||||
margin-left: $card-deck-margin;
|
// 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; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user