Permalink
Browse files

Merge pull request #225 from desmosinc/variable-pos-args

Variable number of position arguments
  • Loading branch information...
slang800 committed Oct 29, 2013
2 parents f3609dd + a024d62 commit dea8a46bca6324a802245ba7441a91cdaa4157c6
Showing with 31 additions and 3 deletions.
  1. +4 −2 lib/nib/positions.styl
  2. +17 −0 test/cases/absolute.css
  3. +10 −1 test/cases/absolute.styl
View
@@ -3,8 +3,10 @@
-pos(type, args)
i = 0
position: unquote(type)
- {args[i]}: args[i + 1] is a 'unit' ? args[i += 1] : 0
- {args[i += 1]}: args[i + 1] is a 'unit' ? args[i += 1] : 0
+ for j in (1..4)
+ if length(args) > i
+ {args[i]}: args[i + 1] is a 'unit' ? args[i += 1] : 0
+ i += 1
/*
* Position utility.
View
@@ -7,4 +7,21 @@
position: absolute;
top: 5px;
left: 10px;
+}
+#login {
+ position: absolute;
+ top: 5px;
+ right: 5px;
+ bottom: 5px;
+}
+#login {
+ position: absolute;
+ top: 0;
+}
+#login {
+ position: absolute;
+ top: 0;
+ right: 5px;
+ bottom: 0;
+ left: 10px;
}
View
@@ -5,4 +5,13 @@
absolute bottom right
#login
- absolute top 5px left 10px
+ absolute top 5px left 10px
+
+#login
+ absolute top 5px right 5px bottom 5px
+
+#login
+ absolute top
+
+#login
+ absolute top right 5px bottom left 10px

0 comments on commit dea8a46

Please sign in to comment.