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

Martynas Barzda Roman Komarov TJ Holowaychuk ven
Martynas Barzda

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;
Martynas Barzda 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
Roman Komarov

Could you add the tests for your case?

TJ Holowaychuk
Owner
tj commented

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

Martynas Barzda 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. Martynas Barzda

    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.
9 lib/nib/positions.styl
View
@@ -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
25 test/cases/absolute.css
View
@@ -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;
+}
+
8 test/cases/absolute.styl
View
@@ -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
39 test/cases/fixed.css
View
@@ -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;
+}
+
6 test/cases/fixed.styl
View
@@ -12,3 +12,9 @@
#login
fixed: bottom 10px right
+
+#login
+ fixed: top
+
+#login
+ fixed: top 10px
34 test/cases/relative.css
View
@@ -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.