diff --git a/lib/nib/positions.styl b/lib/nib/positions.styl index 654d4440..3b412edf 100644 --- a/lib/nib/positions.styl +++ b/lib/nib/positions.styl @@ -4,17 +4,20 @@ 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 args[i+1] + {args[i += 1]}: args[i + 1] is a 'unit' ? args[i += 1] : 0 /* * Position utility. * * Synopsis: * - * fixed: [n] [n] + * fixed: [n] [ [n]] * * Examples: * + * fixed: top + * fixed: top 5px * fixed: top left * fixed: top 5px left * fixed: top left 5px @@ -30,10 +33,12 @@ fixed() * * Synopsis: * - * absolute: [n] [n] + * absolute: [n] [ [n]] * * Examples: * + * absolute: top + * absolute: top 5px * absolute: top left * absolute: top 5px left * absolute: top left 5px @@ -49,10 +54,12 @@ absolute() * * Synopsis: * - * relative: [n] [n] + * relative: [n] [ [n]] * * Examples: * + * relative: top + * relative: top 5px * relative: top left * relative: top 5px left * relative: top left 5px diff --git a/test/cases/absolute.css b/test/cases/absolute.css index 661df5d1..65157482 100644 --- a/test/cases/absolute.css +++ b/test/cases/absolute.css @@ -1,10 +1,28 @@ #login { position: absolute; - bottom: 0; - right: 0; + top: 0; } #login { position: absolute; top: 5px; +} +#login { + position: absolute; + top: 0; + left: 0; +} +#login { + position: absolute; + top: 5px; + left: 10px; +} +#login { + position: absolute; + top: 0; left: 10px; -} \ No newline at end of file +} +#login { + position: absolute; + top: 5px; + left: 0; +} diff --git a/test/cases/absolute.styl b/test/cases/absolute.styl index a4f789d5..79f4b52b 100644 --- a/test/cases/absolute.styl +++ b/test/cases/absolute.styl @@ -2,7 +2,19 @@ @import 'nib/positions' #login - absolute bottom right + absolute: top #login - absolute top 5px left 10px \ No newline at end of file + absolute: top 5px + +#login + absolute: top left + +#login + absolute: top 5px left 10px + +#login + absolute: top left 10px + +#login + absolute: top 5px left \ No newline at end of file diff --git a/test/cases/fixed.css b/test/cases/fixed.css index 4320c328..62a21472 100644 --- a/test/cases/fixed.css +++ b/test/cases/fixed.css @@ -1,7 +1,15 @@ #login { position: fixed; - bottom: 0; - right: 0; + top: 0; +} +#login { + position: fixed; + top: 5px; +} +#login { + position: fixed; + top: 0; + left: 0; } #login { position: fixed; @@ -10,11 +18,11 @@ } #login { position: fixed; - bottom: 0; + top: 0; left: 10px; } #login { position: fixed; - bottom: 10px; - right: 0; -} \ No newline at end of file + top: 5px; + left: 0; +} diff --git a/test/cases/fixed.styl b/test/cases/fixed.styl index c3c9172b..5c257f19 100644 --- a/test/cases/fixed.styl +++ b/test/cases/fixed.styl @@ -2,13 +2,19 @@ @import 'nib/positions' #login - fixed: bottom right + fixed: top + +#login + fixed: top 5px + +#login + fixed: top left #login fixed: top 5px left 10px #login - fixed: bottom left 10px + fixed: top left 10px #login - fixed: bottom 10px right + fixed: top 5px left \ No newline at end of file diff --git a/test/cases/relative.css b/test/cases/relative.css index 389aa3b6..66720425 100644 --- a/test/cases/relative.css +++ b/test/cases/relative.css @@ -1,5 +1,28 @@ - #login { position: relative; + top: 0; +} +#login { + position: relative; + top: 5px; +} +#login { + position: relative; + top: 0; + left: 0; +} +#login { + position: relative; + top: 5px; left: 10px; -} \ No newline at end of file +} +#login { + position: relative; + top: 0; + left: 10px; +} +#login { + position: relative; + top: 5px; + left: 0; +} diff --git a/test/cases/relative.styl b/test/cases/relative.styl new file mode 100644 index 00000000..68d39450 --- /dev/null +++ b/test/cases/relative.styl @@ -0,0 +1,20 @@ + +@import 'nib/positions' + +#login + relative: top + +#login + relative: top 5px + +#login + relative: top left + +#login + relative: top 5px left 10px + +#login + relative: top left 10px + +#login + relative: top 5px left \ No newline at end of file