Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: static/scss/components/_groups.scss

Issue 29453600: Issue 4961 - Fix card group field alignment on acceptableads.com (Closed) Base URL: https://hg.adblockplus.org/web.acceptableads.com
Patch Set: Rebase Created July 5, 2017, 9:19 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « static/scss/components/_cards.scss ('k') | static/scss/layout/_navbar.scss » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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%;
+ }
+ }
+
+}
« no previous file with comments | « static/scss/components/_cards.scss ('k') | static/scss/layout/_navbar.scss » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld