Index: static/scss/components/_groups.scss |
=================================================================== |
--- a/static/scss/components/_groups.scss |
+++ b/static/scss/components/_groups.scss |
@@ -16,23 +16,23 @@ |
// display like a table (even grid) |
.group-container |
{ |
width: 100%; |
max-width: $max-width; |
margin: 0 auto; |
- padding: $md 0; |
+ padding: $xl 0; |
} |
.group-container > %headings, |
.group-container > p |
{ |
- margin: $md auto; |
+ margin: $xl auto; |
padding: 0 $sm; |
} |
.group |
{ |
display: table; |
width: 100%; |
table-layout: fixed; |
@@ -276,8 +276,86 @@ |
// un-center all cards |
.group > div:nth-child(4), |
.group > div:nth-child(3), |
.group > div:nth-child(5) |
{ |
margin-left: 0; |
} |
} |
+ |
+@supports (display: grid) |
+{ |
+ |
+ .group.cards |
+ { |
+ display: grid; |
+ grid-template-columns: repeat(1, 1fr); |
+ |
+ @media (min-width: $card-min-width) |
+ { |
+ // Each card should be a minimum width of the $card-min-width. Otherwise, take up available space |
+ grid-template-columns: repeat(auto-fit, minmax($card-min-width, 1fr)); |
+ } |
+ } |
+ |
+ .group.cards .card |
+ { |
+ display: inline-grid; |
+ width: 100%; |
+ grid-template-rows: auto 1fr auto; |
+ } |
+ |
+ .group.cards .card-summary |
+ { |
+ @media all |
+ { |
+ height: auto; |
+ } |
+ } |
+ |
+ .group-4.cards |
+ { |
+ @media (min-width: $desktop-breakpoint) |
+ { |
+ // Each card should take a minimum of 25% width of the group |
+ grid-template-columns: repeat(auto-fit, minmax(25%, 1fr)); |
+ } |
+ } |
+ |
+ .group-5.cards |
+ { |
+ @media (min-width: $tablet-breakpoint) |
+ { |
+ grid-template-columns: repeat(auto-fit, minmax(33.3%, 1fr)); |
+ } |
+ @media (min-width: $desktop-breakpoint) |
+ { |
+ grid-template-columns: repeat(auto-fit, minmax(20%, 1fr)); |
+ } |
+ } |
+ |
+ .group-5.cards > div:nth-child(4), |
+ .group-5.cards > div:nth-child(5) |
+ { |
+ @media all |
+ { |
+ margin-left: 0; |
+ } |
+ } |
+ |
+ .group-5.cards > div:nth-child(4) |
+ { |
+ @media (min-width: $tablet-breakpoint) and (max-width: $desktop-breakpoint) |
+ { |
+ margin-left: 50%; |
+ } |
+ } |
+ |
+ .group-5.cards > div:nth-child(5) |
+ { |
+ @media (min-width: 700px) and (max-width: $desktop-breakpoint) |
+ { |
+ margin-left: 50%; |
+ } |
+ } |
+ |
+} |