Created
September 14, 2014 11:21
-
-
Save Undistraction/5668102bdc9da8dcee32 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div> | |
<div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div> | |
<div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div> | |
<div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div> | |
<div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div><div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div><div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div> | |
<div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div> | |
<div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div><div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div> | |
<div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.3) | |
// Compass (v1.0.1) | |
// ---- | |
// Offset positioning helpers | |
// Source: http://hugogiraudel.com/2014/05/19/new-offsets-sass-mixin/ | |
// ------------------------------------------------------------------------------------------------- | |
@mixin position($position, $args: ()) { | |
$offsets: top right bottom left; | |
position: $position; | |
@each $offset in $offsets { | |
$index: index($args, $offset); | |
@if $index { | |
@if $index == length($args) { | |
#{$offset}: 0; | |
} | |
@else { | |
$next: nth($args, $index + 1); | |
@if position-is-valid-length($next) { | |
#{$offset}: $next; | |
} | |
@else if index($offsets, $next) { | |
#{$offset}: 0; | |
} | |
@else { | |
@warn "Invalid value `#{$next}` for offset `#{$offset}`."; | |
} | |
} | |
} | |
} | |
} | |
// Function checking if $value is a valid length | |
@function position-is-valid-length($value) { | |
@return (type-of($value) == "number" and not unitless($value)) | |
or (index(auto initial inherit 0, $value) != false); | |
} | |
// Shorthands | |
@mixin absolute($args: ()) { | |
@include position(absolute, $args); | |
} | |
@mixin fixed($args: ()) { | |
@include position(fixed, $args); | |
} | |
@mixin relative($args: ()) { | |
@include position(relative, $args); | |
} | |
.Box | |
{ | |
float: left; | |
} | |
.Box | |
{ | |
position: relative; | |
width:10%; | |
margin-right:0.1%; | |
margin-bottom:0.1%; | |
height:0; | |
padding-bottom: 10%; | |
.Box-inner | |
{ | |
position:absolute; | |
top:0; | |
left:0; | |
width:100%; | |
height: 100%; | |
background: #F4F4F4; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.Box { | |
float: left; | |
} | |
.Box { | |
position: relative; | |
width: 10%; | |
margin-right: 0.1%; | |
margin-bottom: 0.1%; | |
height: 0; | |
padding-bottom: 10%; | |
} | |
.Box .Box-inner { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
background: #F4F4F4; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div> | |
<div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div> | |
<div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div> | |
<div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div> | |
<div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div><div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div><div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div> | |
<div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div> | |
<div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div><div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div> | |
<div class="Box"> | |
<div class="Box-inner"> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment