Skip to content

Commit

Permalink
Addresses Media Object mixin issue in Flex mode. foundation#9038.
Browse files Browse the repository at this point in the history
  • Loading branch information
Martskin committed Sep 25, 2017
1 parent 6ecf7d4 commit 310e3dc
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions scss/components/_media-object.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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;
}
}
}
}

0 comments on commit 310e3dc

Please sign in to comment.