Skip to content

Commit

Permalink
CardDeck: Fix hardcoded max of 3 cards (#5067)
Browse files Browse the repository at this point in the history
  • Loading branch information
stsrki authored Oct 14, 2023
1 parent 5990a0a commit 325265f
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Source/Blazorise.Bootstrap5/Bootstrap5ClassProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ public override string DropdownDirection( Direction direction )

#region Card

public override string CardDeck() => "card-deck row row-cols-1 row-cols-md-3";
public override string CardDeck() => "card-deck";

public override string CardGroup() => "card-group";

Expand Down
24 changes: 21 additions & 3 deletions Source/Blazorise.Bootstrap5/Styles/_card.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
.card-deck .card{
height:100%;
}
.card-deck {
.card {
height: 100%;
margin-bottom: $card-deck-margin;
}

@include media-breakpoint-up(sm) {
display: flex;
flex-flow: row wrap;
margin-right: -$card-deck-margin;
margin-left: -$card-deck-margin;

.card {
// Flexbugs #4: https://github.com/philipwalton/flexbugs#flexbug-4
flex: 1 0 0%;
margin-right: $card-deck-margin;
margin-bottom: 0; // Override the default
margin-left: $card-deck-margin;
}
}
}
15 changes: 15 additions & 0 deletions Source/Blazorise.Bootstrap5/wwwroot/blazorise.bootstrap5.css
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,21 @@ input[type=button].btn-block {

.card-deck .card {
height: 100%;
margin-bottom: 0.75rem;
}
@media (min-width: 576px) {
.card-deck {
display: flex;
flex-flow: row wrap;
margin-right: -0.75rem;
margin-left: -0.75rem;
}
.card-deck .card {
flex: 1 0 0%;
margin-right: 0.75rem;
margin-bottom: 0;
margin-left: 0.75rem;
}
}

.table-fixed-header .table thead tr th.dropdown-table-fixed-header-visible {
Expand Down

Large diffs are not rendered by default.

0 comments on commit 325265f

Please sign in to comment.