Skip to content

Instantly share code, notes, and snippets.

@syahrasi
Last active December 28, 2015 12:29
Show Gist options
  • Save syahrasi/7500610 to your computer and use it in GitHub Desktop.
Save syahrasi/7500610 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
.cf, .media {
*zoom: 1;
}
.cf:after, .media:after {
content: "";
display: table;
clear: both;
}
.media {
display: block;
}
.media__img {
float: left;
margin-right: 1em;
}
.media__img img {
display: block;
}
.islet .media__img {
margin-right: 0.5em;
}
.media__img--rev {
float: right;
margin-left: 1em;
}
.media__img--rev img {
display: block;
}
.islet .media__img--rev {
margin-left: 0.5em;
}
.media__body {
overflow: hidden;
}
.media__body, .media__body > :last-child {
margin-bottom: 0;
}
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
@import "compass";
$base-ui-color: #eee;
$base-spacing-unit: 1em;
$half-spacing-unit: $base-spacing-unit / 2;
.cf {
@include pie-clearfix;
}
@mixin e($name) {
@at-root #{&}__#{$name} {
@content;
}
}
@mixin m($name) {
@at-root #{&}--#{$name} {
@content;
}
}
.media {
display: block;
@extend .cf;
@include e(img) {
float: left;
margin-right: $base-spacing-unit;
& img {
display: block;
}
.islet & {
margin-right: $half-spacing-unit;
}
@include m(rev) {
float: right;
margin-left: $base-spacing-unit;
& img {
display: block;
}
.islet & {
margin-left: $half-spacing-unit;
}
}
}
@include e(body) {
overflow: hidden;
&,
& > :last-child {
margin-bottom: 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment