Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

Added new fandangle spacing mixin
  • Loading branch information...
commit d58227e0dd72d665d8d4351568caf4bbda8ddd61 2 parents 64ebf0a + fa58bc5
@anthonyshort authored
View
3  stylesheets/stitch/patterns/_layout.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';
View
35 stylesheets/stitch/patterns/layout/_spacing.scss
@@ -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" );
Please sign in to comment.
Something went wrong with that request. Please try again.