You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* If you want to add shadow, don't kill the focus style. */
154
+
.my-page .ui-listview .ui-btn:not(.ui-focus) {
149
155
-moz-box-shadow:0px0px9px#111;
150
156
-webkit-box-shadow:0px0px9px#111;
151
157
box-shadow:0px0px9px#111;
152
158
}
153
-
/* Show the focus style on hover as well. */
154
-
.my-page .ui-listview .ui-li.ui-btn:hover {
155
-
-moz-box-shadow:0px0px9px#387bbe;
156
-
-webkit-box-shadow:0px0px9px#387bbe;
157
-
box-shadow:0px0px9px#387bbe;
159
+
/* Images mask the hover bg color so we give desktop users feedback by applying the focus style on hover as well. */
160
+
.my-page .ui-listview .ui-btn:hover {
161
+
-moz-box-shadow:0px0px12px#387bbe;
162
+
-webkit-box-shadow:0px0px12px#387bbe;
163
+
box-shadow:0px0px12px#387bbe;
158
164
}
159
165
/* Animate focus and hover style, and resizing. */
160
-
.my-page .ui-listview .ui-li.ui-btn {
166
+
.my-page .ui-listview .ui-btn {
161
167
-webkit-transition: all 500ms ease;
162
168
-moz-transition: all 500ms ease;
163
169
-o-transition: all 500ms ease;
164
170
-ms-transition: all 500ms ease;
165
171
transition: all 500ms ease;
166
172
}
167
173
}
168
-
/* Second breakpoint. 4 column layout. */
174
+
/* Second breakpoint. 4 column layout. Tiles will be 250x250 pixels again at the breakpoint. */
169
175
@media all and (min-width:1020px){
170
176
.my-page .ui-content {
171
-
padding:10px;/* 1020px - 2 x 10px padding = 1000px */
177
+
padding:10px;
172
178
}
179
+
/* Set a max-width for the last breakpoint to prevent too much stretching on large screens.
180
+
By setting the max-width equal to the breakpoint width minus padding we keep square tiles. */
173
181
.my-page .ui-listview {
174
-
margin:0 auto;
175
182
max-width:1000px;
183
+
margin:0 auto;
176
184
}
177
-
/* We could use pixel width here because 1000px is also the max-width, but let's stick to percentages. */
185
+
/* Because of the 1000px max-width the width will always be 230px (and margin left/right 10px),
186
+
but we stick to percentage values for demo purposes. */
178
187
.my-page .ui-listview .ui-li.ui-btn {
179
-
width:23%;/* 25% incl. 2 x 1% margin */
180
-
height:230px;/* 250px incl. 2 x 10px margin */
188
+
width:23%;
189
+
height:230px;
181
190
margin:10px1%;
182
191
}
183
192
}
184
193
185
-
/* For this demo we used images with a size of 334x334 pixels: 1019px - 18px padding = 1001px x 33.3% = ~334px */
194
+
/* For this demo we used images with a size of 310x310 pixels. Just before the second breakpoint the images reach their max width: 1019px - 2 x 9px padding = 1001px x 30.9333% = ~310px */
/* If you want to add shadow, don't kill the focus style. */
154
+
.my-page .ui-listview .ui-btn:not(.ui-focus) {
149
155
-moz-box-shadow:0px0px9px#111;
150
156
-webkit-box-shadow:0px0px9px#111;
151
157
box-shadow:0px0px9px#111;
152
158
}
153
-
/* Show the focus style on hover as well. */
154
-
.my-page .ui-listview .ui-li.ui-btn:hover {
155
-
-moz-box-shadow:0px0px9px#387bbe;
156
-
-webkit-box-shadow:0px0px9px#387bbe;
157
-
box-shadow:0px0px9px#387bbe;
159
+
/* Images mask the hover bg color so we give desktop users feedback by applying the focus style on hover as well. */
160
+
.my-page .ui-listview .ui-btn:hover {
161
+
-moz-box-shadow:0px0px12px#387bbe;
162
+
-webkit-box-shadow:0px0px12px#387bbe;
163
+
box-shadow:0px0px12px#387bbe;
158
164
}
159
165
/* Animate focus and hover style, and resizing. */
160
-
.my-page .ui-listview .ui-li.ui-btn {
166
+
.my-page .ui-listview .ui-btn {
161
167
-webkit-transition: all 500ms ease;
162
168
-moz-transition: all 500ms ease;
163
169
-o-transition: all 500ms ease;
164
170
-ms-transition: all 500ms ease;
165
171
transition: all 500ms ease;
166
172
}
167
173
}
168
-
/* Second breakpoint. 4 column layout. */
174
+
/* Second breakpoint. 4 column layout. Tiles will be 250x250 pixels again at the breakpoint. */
169
175
@media all and (min-width:1020px){
170
176
.my-page .ui-content {
171
-
padding:10px;/* 1020px - 2 x 10px padding = 1000px */
177
+
padding:10px;
172
178
}
179
+
/* Set a max-width for the last breakpoint to prevent too much stretching on large screens.
180
+
By setting the max-width equal to the breakpoint width minus padding we keep square tiles. */
173
181
.my-page .ui-listview {
174
-
margin:0 auto;
175
182
max-width:1000px;
183
+
margin:0 auto;
176
184
}
177
-
/* We could use pixel width here because 1000px is also the max-width, but let's stick to percentages. */
185
+
/* Because of the 1000px max-width the width will always be 230px (and margin left/right 10px),
186
+
but we stick to percentage values for demo purposes. */
178
187
.my-page .ui-listview .ui-li.ui-btn {
179
-
width:23%;/* 25% incl. 2 x 1% margin */
180
-
height:230px;/* 250px incl. 2 x 10px margin */
188
+
width:23%;
189
+
height:230px;
181
190
margin:10px1%;
182
191
}
183
192
}
184
193
185
-
/* For this demo we used images with a size of 334x334 pixels: 1019px - 18px padding = 1001px x 33.3% = ~334px */
194
+
/* For this demo we used images with a size of 310x310 pixels. Just before the second breakpoint the images reach their max width: 1019px - 2 x 9px padding = 1001px x 30.9333% = ~310px */
186
195
</style>
187
196
</head>
188
197
<body>
@@ -203,9 +212,11 @@ <h1>Grid Listview</h1>
203
212
204
213
<h2>Starting points</h2>
205
214
206
-
<p>Create a listview from an unordered list. For this demo we use an inset listview to show you how you can apply the corner styling to the tiles as well.</p>
215
+
<p>Create a listview from an unordered list. For this demo we used an inset listview to show you how you can apply the corner styling to the tiles as well.</p>
216
+
217
+
<p>In this demo there are two breakpoints. At the first breakpoint we swap from the regular stacked layout to a three column grid layout with tiles. At the second we swith from three to four columns.</p>
207
218
208
-
<p>We will use two breakpoints. At the first breakpoint we swap from a stacked layout to a three column grid layout. At the second we swith from three to four columns.</p>
219
+
<p>The list items have a thumbail. In the grid layout those will get the same size as the tile. One list item doesn't hold an image to demonstrate how you can take advantage of class <code>ui-li-has-thumb</code>to adjust the style.</p>
0 commit comments