Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added number of arguments validation for -pos #127

Closed
wants to merge 2 commits into from

4 participants

@mbarzda

If added one property, generated second line with null property. An ex.:

relative top 100px

Result:

position: relative;
top: 100px;
((null)): 0;

After fix the result is:

position: relative;
top: 100px;
@mbarzda mbarzda Added number of arguments validation for -pos
If added one property, generated second line with null property. An ex.:

relative top 100px >

position: relative;
top: 100px;
((null)): 0;

After fix result is:

position: relative;
top: 100px;
f0f278d
@kizu

Could you add the tests for your case?

@tj
Owner
tj commented

ah yeah I know this problem, a test would be good though

@mbarzda mbarzda closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 23, 2012
  1. @mbarzda

    Added number of arguments validation for -pos

    mbarzda authored
    If added one property, generated second line with null property. An ex.:
    
    relative top 100px >
    
    position: relative;
    top: 100px;
    ((null)): 0;
    
    After fix result is:
    
    position: relative;
    top: 100px;
  2. Added tests and comments for positions mixins

    unknown authored
This page is out of date. Refresh to see the latest.
View
9 lib/nib/positions.styl
@@ -4,7 +4,8 @@
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
+ if length(args) > 2
+ {args[i += 1]}: args[i + 1] is a 'unit' ? args[i += 1] : 0
/*
* Position utility.
@@ -15,6 +16,8 @@
*
* Examples:
*
+ * fixed: top
+ * fixed: top 5px
* fixed: top left
* fixed: top 5px left
* fixed: top left 5px
@@ -34,6 +37,8 @@ fixed()
*
* Examples:
*
+ * absolute: top
+ * absolute: top 5px
* absolute: top left
* absolute: top 5px left
* absolute: top left 5px
@@ -53,6 +58,8 @@ absolute()
*
* Examples:
*
+ * relative: top
+ * relative: top 5px
* relative: top left
* relative: top 5px left
* relative: top left 5px
View
25 test/cases/absolute.css
@@ -1,10 +1,21 @@
#login {
- position: absolute;
- bottom: 0;
- right: 0;
+ position: absolute;
+ bottom: 0;
}
+
#login {
- position: absolute;
- top: 5px;
- left: 10px;
-}
+ position: absolute;
+ top: 5px;
+ left: 10px;
+}
+
+#login {
+ position: absolute;
+ top: 0;
+}
+
+#login {
+ position: absolute;
+ top: 5px;
+}
+
View
8 test/cases/absolute.styl
@@ -5,4 +5,10 @@
absolute bottom right
#login
- absolute top 5px left 10px
+ absolute top 5px left 10px
+
+#login
+ absolute top
+
+#login
+ absolute top 5px
View
39 test/cases/fixed.css
@@ -1,20 +1,33 @@
#login {
- position: fixed;
- bottom: 0;
- right: 0;
+ position: fixed;
+ bottom: 0;
}
+
#login {
- position: fixed;
- top: 5px;
- left: 10px;
+ position: fixed;
+ top: 5px;
+ left: 10px;
}
+
#login {
- position: fixed;
- bottom: 0;
- left: 10px;
+ position: fixed;
+ bottom: 0;
+ left: 10px;
}
+
#login {
- position: fixed;
- bottom: 10px;
- right: 0;
-}
+ position: fixed;
+ bottom: 10px;
+ right: 0;
+}
+
+#login {
+ position: fixed;
+ top: 0;
+}
+
+#login {
+ position: fixed;
+ top: 10px;
+}
+
View
6 test/cases/fixed.styl
@@ -12,3 +12,9 @@
#login
fixed: bottom 10px right
+
+#login
+ fixed: top
+
+#login
+ fixed: top 10px
View
34 test/cases/relative.css
@@ -1,5 +1,33 @@
+#login {
+ position: relative;
+ bottom: 0;
+}
+
+#login {
+ position: relative;
+ top: 5px;
+ left: 10px;
+}
+
+#login {
+ position: relative;
+ bottom: 0;
+ left: 10px;
+}
#login {
- position: relative;
- left: 10px;
-}
+ position: relative;
+ bottom: 10px;
+ right: 0;
+}
+
+#login {
+ position: relative;
+ top: 0;
+}
+
+#login {
+ position: relative;
+ top: 10px;
+}
+
Something went wrong with that request. Please try again.