Permalink
Browse files

Merge pull request #20 from chrisbuttery/feature/spacing-mixin

Added new fandangle spacing mixin
  • Loading branch information...
anthonyshort committed Jul 23, 2012
2 parents 64ebf0a + fa58bc5 commit d58227e0dd72d665d8d4351568caf4bbda8ddd61
Showing with 37 additions and 1 deletion.
  1. +2 −1 stylesheets/stitch/patterns/_layout.scss
  2. +35 −0 stylesheets/stitch/patterns/layout/_spacing.scss
@@ -8,4 +8,5 @@
@import 'layout/absolute';
@import 'layout/relative';
@import 'layout/move';
-@import 'layout/float-children';
+@import 'layout/float-children';
+@import 'layout/spacing';
@@ -0,0 +1,35 @@
+@mixin spacing-classes($base, $list: small normal medium large){
+
+ @for $i from 1 through length($list) {
+
+ .padding-#{nth(unquote($list), $i)} {
+ padding: ($base * $i);
+ }
+
+ .padding-vertical-#{nth(unquote($list), $i)} {
+ padding-top: ($base * $i);
+ padding-bottom: ($base * $i);
+ }
+
+ .padding-horizontal-#{nth(unquote($list), $i)} {
+ padding-right: ($base * $i);
+ padding-left: ($base * $i);
+ }
+
+ .margin-#{nth(unquote($list), $i)} {
+ margin: ($base * $i);
+ }
+
+ .margin-vertical-#{nth(unquote($list), $i)} {
+ margin-top: ($base * $i);
+ margin-bottom: ($base * $i);
+ }
+
+ .margin-horizontal-#{nth(unquote($list), $i)} {
+ margin-right: ($base * $i);
+ margin-left: ($base * $i);
+ }
+ }
+}
+
+//@include spacing-classes(20px, $list: "big" "bigger" "biggerer" "biggest" );

0 comments on commit d58227e

Please sign in to comment.