Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 // This file is part of acceptableads.org. | 1 // This file is part of acceptableads.org. |
2 // Copyright (C) 2016 Eyeo GmbH | 2 // Copyright (C) 2016 Eyeo GmbH |
3 // | 3 // |
4 // acceptableads.org is free software: you can redistribute it and/or modify | 4 // acceptableads.org is free software: you can redistribute it and/or modify |
5 // it under the terms of the GNU General Public License as published by | 5 // it under the terms of the GNU General Public License as published by |
6 // the Free Software Foundation, either version 3 of the License, or | 6 // the Free Software Foundation, either version 3 of the License, or |
7 // (at your option) any later version. | 7 // (at your option) any later version. |
8 // | 8 // |
9 // acceptableads.org is distributed in the hope that it will be useful, | 9 // acceptableads.org is distributed in the hope that it will be useful, |
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 // GNU General Public License for more details. | 12 // GNU General Public License for more details. |
13 // | 13 // |
14 // You should have received a copy of the GNU General Public License | 14 // You should have received a copy of the GNU General Public License |
15 // along with acceptableads.org. If not, see <http://www.gnu.org/licenses/>. | 15 // along with acceptableads.org. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 |
17 // display like a table (even grid) | 17 // display like a table (even grid) |
18 | 18 |
19 .group-container | 19 .group-container |
20 { | 20 { |
21 width: 100%; | 21 width: 100%; |
22 max-width: $max-width; | 22 max-width: $max-width; |
23 margin: 0 auto; | 23 margin: 0 auto; |
24 padding: $xl 0; | 24 padding: $xl 0; |
25 | |
26 @media (max-width: $desktop-breakpoint) | |
27 { | |
28 padding: $xs; | |
29 } | |
25 } | 30 } |
26 | 31 |
27 .group-container > %headings, | 32 .group-container > %headings, |
28 .group-container > p | 33 .group-container > p |
29 { | 34 { |
30 margin: $xl auto; | 35 margin: $lg auto; |
31 padding: 0 $sm; | 36 padding: 0 $sm; |
37 } | |
38 | |
39 .group-container > p | |
40 { | |
41 @media (max-width: $desktop-breakpoint) | |
42 { | |
43 margin: $md auto; | |
44 } | |
32 } | 45 } |
33 | 46 |
34 .group | 47 .group |
35 { | 48 { |
36 display: table; | 49 display: table; |
37 width: 100%; | 50 width: 100%; |
38 table-layout: fixed; | 51 table-layout: fixed; |
39 } | 52 } |
40 | 53 |
41 .group-container .group | 54 .group-container .group |
42 { | 55 { |
43 margin-bottom: 0; | 56 margin-bottom: 0; |
44 } | 57 } |
45 | 58 |
46 .group-container > %headings | 59 .group-container > %headings |
47 { | 60 { |
48 margin-top: 0; | 61 margin-top: 0; |
62 | |
63 @media (max-width: $desktop-breakpoint) | |
64 { | |
65 margin: $md auto; | |
66 } | |
49 } | 67 } |
50 | 68 |
51 .group .card, | 69 .group .card, |
52 .group .item | 70 .group .item |
53 { | 71 { |
54 display: table-cell; | 72 display: table-cell; |
55 vertical-align: top; | 73 vertical-align: top; |
56 } | 74 } |
57 | 75 |
58 .group.items .item::before | 76 .group.items .item::before |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
275 } | 293 } |
276 // un-center all cards | 294 // un-center all cards |
277 .group > div:nth-child(4), | 295 .group > div:nth-child(4), |
278 .group > div:nth-child(3), | 296 .group > div:nth-child(3), |
279 .group > div:nth-child(5) | 297 .group > div:nth-child(5) |
280 { | 298 { |
281 margin-left: 0; | 299 margin-left: 0; |
282 } | 300 } |
283 } | 301 } |
284 | 302 |
285 @supports (display: grid) | 303 @supports (display: grid) |
286 { | 304 { |
287 | 305 |
288 .group | 306 .group.cards |
289 { | 307 { |
290 display: grid; | 308 display: grid; |
291 // Each card should be a minimum width of the $card-max-width. Otherwise, ta ke up available space | 309 grid-template-columns: repeat(1, 1fr); |
292 grid-template-columns: repeat(auto-fit, minmax($card-max-width, 1fr)); | 310 |
293 } | 311 @media (min-width: $card-min-width) |
294 | 312 { |
295 .group .card | 313 // Each card should be a minimum width of the $card-min-width. Otherwise, take up available space |
314 grid-template-columns: repeat(auto-fit, minmax($card-min-width, 1fr)); | |
315 } | |
316 } | |
317 | |
318 .group.cards .card | |
296 { | 319 { |
297 display: inline-grid; | 320 display: inline-grid; |
298 } | 321 width: 100%; |
299 | 322 grid-template-rows: auto 1fr auto; |
300 .group-4 | 323 } |
301 { | 324 |
302 @media (min-width: $desktop-breakpoint) | 325 .group.cards .card-summary |
326 { | |
327 height: auto; | |
328 } | |
329 | |
330 .group-4.cards | |
331 { | |
332 @media (min-width: $desktop-breakpoint) | |
303 { | 333 { |
304 // Each card should take a minimum of 25% width of the group | 334 // Each card should take a minimum of 25% width of the group |
305 grid-template-columns: repeat(auto-fit, minmax(25%, 1fr)); | 335 grid-template-columns: repeat(auto-fit, minmax(25%, 1fr)); |
306 } | 336 } |
307 } | 337 } |
308 | 338 |
309 .group-5 | 339 .group-5.cards |
juliandoucette
2017/06/16 19:39:17
I'm not sure how/why yet - but this patchset seems
ire
2017/06/21 07:47:58
I've fixed the centering of the last card in 5 car
| |
310 { | 340 { |
311 @media (min-width: $desktop-breakpoint) | 341 @media (min-width: $tablet-breakpoint) |
342 { | |
343 grid-template-columns: repeat(auto-fit, minmax(33.3%, 1fr)); | |
344 } | |
345 @media (min-width: $desktop-breakpoint) | |
312 { | 346 { |
313 grid-template-columns: repeat(auto-fit, minmax(20%, 1fr)); | 347 grid-template-columns: repeat(auto-fit, minmax(20%, 1fr)); |
314 } | 348 } |
315 } | 349 } |
316 | 350 |
317 .group-5 > div:nth-child(4) | 351 .group-5.cards > div:nth-child(4), |
ire
2017/06/13 16:51:23
Since this is overwriting a previous style, I stuc
juliandoucette
2017/06/16 19:39:17
Acknowledged.
| |
318 { | 352 .group-5.cards > div:nth-child(5) |
319 @media all | 353 { |
juliandoucette
2017/06/16 19:39:17
Why @media all?
ire
2017/06/21 07:47:58
See comment above
| |
320 { | 354 margin-left: 0; |
321 margin-left: 0; | 355 } |
322 } | 356 |
323 } | 357 .group-5.cards > div:nth-child(4) |
324 | 358 { |
325 } | 359 @media (min-width: $tablet-breakpoint) and (max-width: $desktop-breakpoint - 1px) |
360 { | |
361 margin-left: 50%; | |
362 } | |
363 } | |
364 | |
365 .group-5.cards > div:nth-child(5) | |
366 { | |
367 @media (min-width: 700px) and (max-width: $desktop-breakpoint - 1px) | |
368 { | |
369 margin-left: 50%; | |
370 } | |
371 } | |
372 } | |
LEFT | RIGHT |