]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Addresses Media Object mixin issue in Flex mode. #9038.
authorMartin Hofmann <martin@martinhofmann.com>
Mon, 25 Sep 2017 19:40:19 +0000 (12:40 -0700)
committerMartin Hofmann <martin@martinhofmann.com>
Mon, 25 Sep 2017 19:40:19 +0000 (12:40 -0700)
scss/components/_media-object.scss

index 3c85f46f556d2dfbce11c627836cdac6f60f8e1f..0ae8c51a62f7f692195d934f6a6ebd7cacbf6d93 100644 (file)
@@ -26,6 +26,18 @@ $mediaobject-image-width-stacked: 100% !default;
   @if $global-flexbox {
     flex-wrap: nowrap;
   }
+
+  img {
+    max-width: none;
+  }
+
+  @if $global-flexbox {
+    &.stack-for-#{$-zf-zero-breakpoint} {
+      @include breakpoint($-zf-zero-breakpoint only) {
+        flex-wrap: wrap;
+      }
+    }
+  }
 }
 
 /// Adds styles for sections within a media object.
@@ -50,6 +62,27 @@ $mediaobject-image-width-stacked: 100% !default;
   > :last-child {
     margin-bottom: 0;
   }
+
+  .stack-for-#{$-zf-zero-breakpoint} & {
+    @include breakpoint($-zf-zero-breakpoint only) {
+      @include media-object-stack;
+    }
+  }
+
+  @if $global-flexbox {
+    &.main-section {
+      flex: 1 1 0px; // sass-lint:disable-line zero-unit
+    }
+  }
+  @else {
+    &.middle {
+      vertical-align: middle;
+    }
+
+    &.bottom {
+      vertical-align: bottom;
+    }
+  }
 }
 
 /// Adds styles to stack sections of a media object. Apply this to the section elements, not the container.
@@ -73,42 +106,9 @@ $mediaobject-image-width-stacked: 100% !default;
 @mixin foundation-media-object {
   .media-object {
     @include media-object-container;
-
-    img {
-      max-width: none;
-    }
-
-    @if $global-flexbox {
-      &.stack-for-#{$-zf-zero-breakpoint} {
-        @include breakpoint($-zf-zero-breakpoint only) {
-          flex-wrap: wrap;
-        }
-      }
-    }
-
-    &.stack-for-#{$-zf-zero-breakpoint} .media-object-section {
-      @include breakpoint($-zf-zero-breakpoint only) {
-        @include media-object-stack;
-      }
-    }
   }
 
   .media-object-section {
     @include media-object-section;
-
-    @if $global-flexbox {
-      &.main-section {
-        flex: 1 1 0px; // sass-lint:disable-line zero-unit
-      }
-    }
-    @else {
-      &.middle {
-        vertical-align: middle;
-      }
-
-      &.bottom {
-        vertical-align: bottom;
-      }
-    }
   }
 }