From bb24733f418709e2e6b1311616bed30d89ba21c9 Mon Sep 17 00:00:00 2001 From: Kevin Ball Date: Mon, 26 Jun 2017 12:14:29 -0700 Subject: [PATCH] Brute force the auto override issue --- scss/xy-grid/_classes.scss | 27 ++++++++++++++++++++++----- test/visual/xy-grid/kitchen-sink.html | 5 +++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/scss/xy-grid/_classes.scss b/scss/xy-grid/_classes.scss index b4d3e115f..0f4d88905 100644 --- a/scss/xy-grid/_classes.scss +++ b/scss/xy-grid/_classes.scss @@ -44,12 +44,22 @@ // Auto width @include -zf-each-breakpoint() { - // This is a bit of a hack/workaround, see these PRs for the backstory: + // This is a bit of a hack/workaround, see these issues & PRs for the backstory: + // https://github.com/zurb/foundation-sites/issues/10244 // https://github.com/zurb/foundation-sites/pull/10222 and // https://github.com/zurb/foundation-sites/pull/10164 - .grid-x > [class*="#{$-zf-size}-"]:not([class*="#{$-zf-size}-order"]):not([class*="#{$-zf-size}-offset"]) { - flex-basis: auto; + .grid-x { + $str: "> #{$-zf-size}-shrink, > #{$-zf-size}-full"; + @for $i from 1 through $grid-columns { + $str: $str + ", > #{$-zf-size}-#{$i}" + } + #{$str} { + flex-basis: auto; + } } + } + + @include -zf-each-breakpoint() { @if not($-zf-size == small) { .grid-x > .#{$-zf-size}-auto { @include xy-cell-base(auto); @@ -257,13 +267,20 @@ @include -zf-each-breakpoint() { - // This is a bit of a hack/workaround, see these PRs for the backstory: + // This is a bit of a hack/workaround, see these issues and PRs for the backstory: + // https://github.com/zurb/foundation-sites/issues/10244 // https://github.com/zurb/foundation-sites/pull/10222 and // https://github.com/zurb/foundation-sites/pull/10164 - > [class*="#{$-zf-size}-"]:not([class*="#{$-zf-size}-order"]):not([class*="#{$-zf-size}-offset"]) { + $str: "> #{$-zf-size}-shrink, > #{$-zf-size}-full"; + @for $i from 1 through $grid-columns { + $str: $str + ", > #{$-zf-size}-#{$i}" + } + #{$str} { flex-basis: auto; } + } + @include -zf-each-breakpoint() { @if not($-zf-size == small) { > .#{$-zf-size}-auto { @include xy-cell-base(auto); diff --git a/test/visual/xy-grid/kitchen-sink.html b/test/visual/xy-grid/kitchen-sink.html index 423acd033..31faca17e 100644 --- a/test/visual/xy-grid/kitchen-sink.html +++ b/test/visual/xy-grid/kitchen-sink.html @@ -139,6 +139,11 @@
7 on small, shrink on large
+
+
5 on small, auto on large with a ton of content that should still be even
+
7 on small, auto on large
+
+

Margin - collapse

The cells should collapse on large screens and above.

-- 2.47.2