Skip to content

Commit

Permalink
fix(grid): add ion-grid element which wraps the rows/cols and adds pa…
Browse files Browse the repository at this point in the history
…dding

update tests to use new ion-grid element

references #6238
  • Loading branch information
brandyscarney committed Apr 26, 2016
1 parent a48ee6e commit a0c0228
Show file tree
Hide file tree
Showing 3 changed files with 306 additions and 300 deletions.
116 changes: 61 additions & 55 deletions ionic/components/card/test/advanced/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,22 @@
</p>
</ion-card-content>

<ion-row>
<ion-col no-padding>
<button clear small>
<ion-icon name="star"></ion-icon>
Star
</button>
</ion-col>
<ion-col no-padding text-right>
<button clear small class="activated">
<ion-icon name="share"></ion-icon>
Activated
</button>
</ion-col>
</ion-row>
<ion-grid>
<ion-row>
<ion-col no-padding>
<button clear small>
<ion-icon name="star"></ion-icon>
Star
</button>
</ion-col>
<ion-col no-padding text-right>
<button clear small class="activated">
<ion-icon name="share"></ion-icon>
Activated
</button>
</ion-col>
</ion-row>
</ion-grid>

</ion-card>

Expand All @@ -55,26 +57,28 @@ <h2>Card With An Inset Picture</h2>
<p>Hello. I am a paragraph.</p>
</ion-card-content>

<ion-row>
<ion-col no-padding>
<button clear small>
<ion-icon name="star"></ion-icon>
Favorite
</button>
</ion-col>
<ion-col no-padding text-center>
<button clear small>
<ion-icon name="musical-notes"></ion-icon>
Listen
</button>
</ion-col>
<ion-col no-padding text-right>
<button clear small danger class="activated">
<ion-icon name="share"></ion-icon>
Activated
</button>
</ion-col>
</ion-row>
<ion-grid>
<ion-row>
<ion-col no-padding>
<button clear small>
<ion-icon name="star"></ion-icon>
Favorite
</button>
</ion-col>
<ion-col no-padding text-center>
<button clear small>
<ion-icon name="musical-notes"></ion-icon>
Listen
</button>
</ion-col>
<ion-col no-padding text-right>
<button clear small danger class="activated">
<ion-icon name="share"></ion-icon>
Activated
</button>
</ion-col>
</ion-row>
</ion-grid>
</ion-card>

<ion-card>
Expand All @@ -87,27 +91,29 @@ <h2>Card With An Inset Picture</h2>
This card was breaking the border radius.
</ion-card-content>

<ion-row>
<ion-col no-padding>
<button clear small dark>
<ion-icon name="star"></ion-icon>
Favorite
</button>
</ion-col>

<ion-col no-padding text-center>
<button clear small dark>
<ion-icon name="musical-notes"></ion-icon>
Listen
</button>
</ion-col>
<ion-col no-padding text-right>
<button clear small dark>
<ion-icon name="share-alt"></ion-icon>
Share
</button>
</ion-col>
</ion-row>
<ion-grid>
<ion-row>
<ion-col no-padding>
<button clear small dark>
<ion-icon name="star"></ion-icon>
Favorite
</button>
</ion-col>

<ion-col no-padding text-center>
<button clear small dark>
<ion-icon name="musical-notes"></ion-icon>
Listen
</button>
</ion-col>
<ion-col no-padding text-right>
<button clear small dark>
<ion-icon name="share-alt"></ion-icon>
Share
</button>
</ion-col>
</ion-row>
</ion-grid>

</ion-card>

Expand Down
20 changes: 9 additions & 11 deletions ionic/components/grid/grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,25 @@ $grid-responsive-lg-break: 1023px !default; // smaller than landscape tab
}
}


ion-row {
ion-grid {
display: flex;

flex-direction: column;

padding: ($grid-padding-width / 2);

width: 100%;
}

ion-row {
display: flex;

width: 100%;

&[wrap] {
flex-wrap: wrap;
}

&[flush] {
padding: 0;
}

&[top] {
align-items: flex-start;
}
Expand All @@ -82,11 +85,6 @@ ion-row {
}
}

ion-row + ion-row {
margin-top: ($grid-padding-width / 2) * -1;
padding-top: 0;
}

ion-col {
display: block;

Expand Down
Loading

0 comments on commit a0c0228

Please sign in to comment.