Created
June 11, 2014 06:31
-
-
Save sugarenia/a66301cfcaa1178e131e to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains 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.3.8) | |
// Compass (v1.0.0.alpha.19) | |
// ---- | |
/** | |
* Spacing helpers | |
* @author Luke Askew | |
*/ | |
$properties: margin padding; | |
$directions: top right bottom left; | |
$sizes: ( | |
xx-small: 0.3em, | |
x-small: 0.5em, | |
small: 0.8em, | |
large: 1.3em, | |
x-large: 1.5em, | |
xx-large: 1.8em | |
); | |
@for $direction from 0 to length($directions) { | |
@for $property from 0 to length($properties) { | |
// save property + direction | |
$base: nth($properties, $property + 1) + "-" + nth($directions, $direction + 1); | |
// default spacing | |
.#{$base} { | |
#{$base}: 1em; | |
} | |
// spacing for each size | |
@each $size, $value in $sizes { | |
.#{$base}#{--$size} { | |
#{$base}: $value; | |
} | |
} | |
} | |
} |
This file contains 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
/** | |
* Spacing helpers | |
* @author Luke Askew | |
*/ | |
.margin-top { | |
margin-top: 1em; | |
} | |
.margin-top--xx-small { | |
margin-top: 0.3em; | |
} | |
.margin-top--x-small { | |
margin-top: 0.5em; | |
} | |
.margin-top--small { | |
margin-top: 0.8em; | |
} | |
.margin-top--large { | |
margin-top: 1.3em; | |
} | |
.margin-top--x-large { | |
margin-top: 1.5em; | |
} | |
.margin-top--xx-large { | |
margin-top: 1.8em; | |
} | |
.padding-top { | |
padding-top: 1em; | |
} | |
.padding-top--xx-small { | |
padding-top: 0.3em; | |
} | |
.padding-top--x-small { | |
padding-top: 0.5em; | |
} | |
.padding-top--small { | |
padding-top: 0.8em; | |
} | |
.padding-top--large { | |
padding-top: 1.3em; | |
} | |
.padding-top--x-large { | |
padding-top: 1.5em; | |
} | |
.padding-top--xx-large { | |
padding-top: 1.8em; | |
} | |
.margin-right { | |
margin-right: 1em; | |
} | |
.margin-right--xx-small { | |
margin-right: 0.3em; | |
} | |
.margin-right--x-small { | |
margin-right: 0.5em; | |
} | |
.margin-right--small { | |
margin-right: 0.8em; | |
} | |
.margin-right--large { | |
margin-right: 1.3em; | |
} | |
.margin-right--x-large { | |
margin-right: 1.5em; | |
} | |
.margin-right--xx-large { | |
margin-right: 1.8em; | |
} | |
.padding-right { | |
padding-right: 1em; | |
} | |
.padding-right--xx-small { | |
padding-right: 0.3em; | |
} | |
.padding-right--x-small { | |
padding-right: 0.5em; | |
} | |
.padding-right--small { | |
padding-right: 0.8em; | |
} | |
.padding-right--large { | |
padding-right: 1.3em; | |
} | |
.padding-right--x-large { | |
padding-right: 1.5em; | |
} | |
.padding-right--xx-large { | |
padding-right: 1.8em; | |
} | |
.margin-bottom { | |
margin-bottom: 1em; | |
} | |
.margin-bottom--xx-small { | |
margin-bottom: 0.3em; | |
} | |
.margin-bottom--x-small { | |
margin-bottom: 0.5em; | |
} | |
.margin-bottom--small { | |
margin-bottom: 0.8em; | |
} | |
.margin-bottom--large { | |
margin-bottom: 1.3em; | |
} | |
.margin-bottom--x-large { | |
margin-bottom: 1.5em; | |
} | |
.margin-bottom--xx-large { | |
margin-bottom: 1.8em; | |
} | |
.padding-bottom { | |
padding-bottom: 1em; | |
} | |
.padding-bottom--xx-small { | |
padding-bottom: 0.3em; | |
} | |
.padding-bottom--x-small { | |
padding-bottom: 0.5em; | |
} | |
.padding-bottom--small { | |
padding-bottom: 0.8em; | |
} | |
.padding-bottom--large { | |
padding-bottom: 1.3em; | |
} | |
.padding-bottom--x-large { | |
padding-bottom: 1.5em; | |
} | |
.padding-bottom--xx-large { | |
padding-bottom: 1.8em; | |
} | |
.margin-left { | |
margin-left: 1em; | |
} | |
.margin-left--xx-small { | |
margin-left: 0.3em; | |
} | |
.margin-left--x-small { | |
margin-left: 0.5em; | |
} | |
.margin-left--small { | |
margin-left: 0.8em; | |
} | |
.margin-left--large { | |
margin-left: 1.3em; | |
} | |
.margin-left--x-large { | |
margin-left: 1.5em; | |
} | |
.margin-left--xx-large { | |
margin-left: 1.8em; | |
} | |
.padding-left { | |
padding-left: 1em; | |
} | |
.padding-left--xx-small { | |
padding-left: 0.3em; | |
} | |
.padding-left--x-small { | |
padding-left: 0.5em; | |
} | |
.padding-left--small { | |
padding-left: 0.8em; | |
} | |
.padding-left--large { | |
padding-left: 1.3em; | |
} | |
.padding-left--x-large { | |
padding-left: 1.5em; | |
} | |
.padding-left--xx-large { | |
padding-left: 1.8em; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment