Browse files

Add position mixin back in

  • Loading branch information...
1 parent e80651d commit 7a4b50d7a09bef311da9c5333185a21ba0981db7 Chad Mazzola committed Jul 3, 2011
Showing with 32 additions and 0 deletions.
  1. +2 −0 app/assets/stylesheets/_bourbon.css.scss
  2. +30 −0 app/assets/stylesheets/addons/_position.css.scss
View
2 app/assets/stylesheets/_bourbon.css.scss
@@ -10,9 +10,11 @@
@import "css3/flex-box";
@import "css3/inline-block";
@import "css3/linear-gradient";
+@import "css3/position";
@import "css3/radial-gradient";
@import "css3/transform";
@import "css3/transition";
// Addons & other mixins
@import "addons/button";
+@import "addons/position";
View
30 app/assets/stylesheets/addons/_position.css.scss
@@ -0,0 +1,30 @@
+@mixin position ($position: relative, $coordinates: 0 0 0 0) {
+
+ @if type-of($position) == list {
+ $coordinates: $position;
+ $position: relative;
+ }
+
+ $top: nth($coordinates, 1);
+ $right: nth($coordinates, 2);
+ $bottom: nth($coordinates, 3);
+ $left: nth($coordinates, 4);
+
+ position: $position;
+
+ @if not(unitless($top)) {
+ top: $top;
+ }
+
+ @if not(unitless($right)) {
+ right: $right;
+ }
+
+ @if not(unitless($bottom)) {
+ bottom: $bottom;
+ }
+
+ @if not(unitless($left)) {
+ left: $left;
+ }
+}

0 comments on commit 7a4b50d

Please sign in to comment.