Skip to content

Commit a0c0228

Browse files
committed
fix(grid): add ion-grid element which wraps the rows/cols and adds padding
update tests to use new ion-grid element references #6238
1 parent a48ee6e commit a0c0228

File tree

3 files changed

+306
-300
lines changed

3 files changed

+306
-300
lines changed

ionic/components/card/test/advanced/main.html

Lines changed: 61 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,22 @@
1919
</p>
2020
</ion-card-content>
2121

22-
<ion-row>
23-
<ion-col no-padding>
24-
<button clear small>
25-
<ion-icon name="star"></ion-icon>
26-
Star
27-
</button>
28-
</ion-col>
29-
<ion-col no-padding text-right>
30-
<button clear small class="activated">
31-
<ion-icon name="share"></ion-icon>
32-
Activated
33-
</button>
34-
</ion-col>
35-
</ion-row>
22+
<ion-grid>
23+
<ion-row>
24+
<ion-col no-padding>
25+
<button clear small>
26+
<ion-icon name="star"></ion-icon>
27+
Star
28+
</button>
29+
</ion-col>
30+
<ion-col no-padding text-right>
31+
<button clear small class="activated">
32+
<ion-icon name="share"></ion-icon>
33+
Activated
34+
</button>
35+
</ion-col>
36+
</ion-row>
37+
</ion-grid>
3638

3739
</ion-card>
3840

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

58-
<ion-row>
59-
<ion-col no-padding>
60-
<button clear small>
61-
<ion-icon name="star"></ion-icon>
62-
Favorite
63-
</button>
64-
</ion-col>
65-
<ion-col no-padding text-center>
66-
<button clear small>
67-
<ion-icon name="musical-notes"></ion-icon>
68-
Listen
69-
</button>
70-
</ion-col>
71-
<ion-col no-padding text-right>
72-
<button clear small danger class="activated">
73-
<ion-icon name="share"></ion-icon>
74-
Activated
75-
</button>
76-
</ion-col>
77-
</ion-row>
60+
<ion-grid>
61+
<ion-row>
62+
<ion-col no-padding>
63+
<button clear small>
64+
<ion-icon name="star"></ion-icon>
65+
Favorite
66+
</button>
67+
</ion-col>
68+
<ion-col no-padding text-center>
69+
<button clear small>
70+
<ion-icon name="musical-notes"></ion-icon>
71+
Listen
72+
</button>
73+
</ion-col>
74+
<ion-col no-padding text-right>
75+
<button clear small danger class="activated">
76+
<ion-icon name="share"></ion-icon>
77+
Activated
78+
</button>
79+
</ion-col>
80+
</ion-row>
81+
</ion-grid>
7882
</ion-card>
7983

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

90-
<ion-row>
91-
<ion-col no-padding>
92-
<button clear small dark>
93-
<ion-icon name="star"></ion-icon>
94-
Favorite
95-
</button>
96-
</ion-col>
97-
98-
<ion-col no-padding text-center>
99-
<button clear small dark>
100-
<ion-icon name="musical-notes"></ion-icon>
101-
Listen
102-
</button>
103-
</ion-col>
104-
<ion-col no-padding text-right>
105-
<button clear small dark>
106-
<ion-icon name="share-alt"></ion-icon>
107-
Share
108-
</button>
109-
</ion-col>
110-
</ion-row>
94+
<ion-grid>
95+
<ion-row>
96+
<ion-col no-padding>
97+
<button clear small dark>
98+
<ion-icon name="star"></ion-icon>
99+
Favorite
100+
</button>
101+
</ion-col>
102+
103+
<ion-col no-padding text-center>
104+
<button clear small dark>
105+
<ion-icon name="musical-notes"></ion-icon>
106+
Listen
107+
</button>
108+
</ion-col>
109+
<ion-col no-padding text-right>
110+
<button clear small dark>
111+
<ion-icon name="share-alt"></ion-icon>
112+
Share
113+
</button>
114+
</ion-col>
115+
</ion-row>
116+
</ion-grid>
111117

112118
</ion-card>
113119

ionic/components/grid/grid.scss

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,25 @@ $grid-responsive-lg-break: 1023px !default; // smaller than landscape tab
4545
}
4646
}
4747

48-
49-
ion-row {
48+
ion-grid {
5049
display: flex;
5150

51+
flex-direction: column;
52+
5253
padding: ($grid-padding-width / 2);
5354

5455
width: 100%;
56+
}
57+
58+
ion-row {
59+
display: flex;
60+
61+
width: 100%;
5562

5663
&[wrap] {
5764
flex-wrap: wrap;
5865
}
5966

60-
&[flush] {
61-
padding: 0;
62-
}
63-
6467
&[top] {
6568
align-items: flex-start;
6669
}
@@ -82,11 +85,6 @@ ion-row {
8285
}
8386
}
8487

85-
ion-row + ion-row {
86-
margin-top: ($grid-padding-width / 2) * -1;
87-
padding-top: 0;
88-
}
89-
9088
ion-col {
9189
display: block;
9290

0 commit comments

Comments
 (0)