Skip to content

Commit

Permalink
Simplify markup for CardGroup at the expense of added specificity in …
Browse files Browse the repository at this point in the history
…the styles. (#12183)
  • Loading branch information
cjcenizal authored Jun 6, 2017
1 parent 7b7cf51 commit cfe0e7b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 35 deletions.
14 changes: 7 additions & 7 deletions ui_framework/components/card/_card_group.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
.kuiCardGroup {
display: flex;
flex-wrap: wrap; /* 1 */
}

/**
* 1. Use the defined width of the card to determine when to wrap.
* 2. Use an even margin all around the card so that the spacing is still even when wrapped.
*/
.kuiCardGroup__card {
.kuiCard {
flex: 1 1 0; /* 1 */
margin: $cardSpacing; /* 2 */
}

.kuiCardGroup__cardDescription {
flex: 1 1 auto;
.kuiCard__description {
flex: 1 1 auto;
}
}
}

/**
* 1. There's no way to make this look good when wrapped.
Expand All @@ -35,13 +35,13 @@
border-radius: $globalBorderRadius;
overflow: hidden;

.kuiCardGroup__card {
.kuiCard {
border: none;
border-radius: 0;
margin: 0;
}

.kuiCardGroup__card + .kuiCardGroup__card {
.kuiCard + .kuiCard {
border-left: 1px solid $cardBorderColor;
}
}
38 changes: 18 additions & 20 deletions ui_framework/dist/ui_framework.css
Original file line number Diff line number Diff line change
Expand Up @@ -534,26 +534,24 @@ body {
-webkit-flex-wrap: wrap;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
/* 1 */ }

/**
/* 1 */
/**
* 1. Use the defined width of the card to determine when to wrap.
* 2. Use an even margin all around the card so that the spacing is still even when wrapped.
*/
.kuiCardGroup__card {
-webkit-box-flex: 1;
-webkit-flex: 1 1 0;
-ms-flex: 1 1 0px;
flex: 1 1 0;
/* 1 */
margin: 15px;
/* 2 */ }

.kuiCardGroup__cardDescription {
-webkit-box-flex: 1;
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto; }
*/ }
.kuiCardGroup .kuiCard {
-webkit-box-flex: 1;
-webkit-flex: 1 1 0;
-ms-flex: 1 1 0px;
flex: 1 1 0;
/* 1 */
margin: 15px;
/* 2 */ }
.kuiCardGroup .kuiCard .kuiCard__description {
-webkit-box-flex: 1;
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto; }

/**
* 1. There's no way to make this look good when wrapped.
Expand All @@ -566,11 +564,11 @@ body {
border: 1px solid #E0E0E0;
border-radius: 4px;
overflow: hidden; }
.kuiCardGroup--united .kuiCardGroup__card {
.kuiCardGroup--united .kuiCard {
border: none;
border-radius: 0;
margin: 0; }
.kuiCardGroup--united .kuiCardGroup__card + .kuiCardGroup__card {
.kuiCardGroup--united .kuiCard + .kuiCard {
border-left: 1px solid #E0E0E0; }

.kuiCollapseButton {
Expand Down
16 changes: 8 additions & 8 deletions ui_framework/doc_site/src/views/card/card_group.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="kuiCardGroupContainer">
<div class="kuiCardGroup">
<div class="kuiCard kuiCardGroup__card" style="width: 400px">
<div class="kuiCard__description kuiCardGroup__cardDescription">
<div class="kuiCard" style="width: 400px">
<div class="kuiCard__description">
<div class="kuiCard__descriptionTitle">
Get a banana
</div>
Expand All @@ -18,8 +18,8 @@
</div>
</div>

<div class="kuiCard kuiCardGroup__card" style="width: 400px">
<div class="kuiCard__description kuiCardGroup__cardDescription">
<div class="kuiCard" style="width: 400px">
<div class="kuiCard__description">
<div class="kuiCard__descriptionTitle">
Get a pteradactyl
</div>
Expand All @@ -45,8 +45,8 @@
<br class="guideBreak">

<div class="kuiCardGroup kuiCardGroup--united">
<div class="kuiCard kuiCardGroup__card">
<div class="kuiCard__description kuiCardGroup__cardDescription">
<div class="kuiCard">
<div class="kuiCard__description">
<div class="kuiCard__descriptionTitle">
Get a banana
</div>
Expand All @@ -63,8 +63,8 @@
</div>
</div>

<div class="kuiCard kuiCardGroup__card">
<div class="kuiCard__description kuiCardGroup__cardDescription">
<div class="kuiCard">
<div class="kuiCard__description">
<div class="kuiCard__descriptionTitle">
Get a pteradactyl
</div>
Expand Down

0 comments on commit cfe0e7b

Please sign in to comment.