From b07e5849cdddc993da677d9790e2d6fb1397c3b2 Mon Sep 17 00:00:00 2001 From: Julien Kernec'h Date: Tue, 26 Jul 2011 20:38:19 +0200 Subject: [PATCH 01/82] added support for background-clip --- lib/nib/vendor.styl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 2e3613fb..b3491e46 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -49,6 +49,13 @@ column-count() column-gap() vendor('column-gap', arguments) +/* + * Vendor "background-clip" support. + */ + +background-clip() + vendor('background-clip', arguments) + /* * Vendor "background-size" support. */ @@ -207,4 +214,4 @@ border-radius() if augmented -apply-border-radius(pos) pos = () - vendor('border-radius', pos) unless augmented \ No newline at end of file + vendor('border-radius', pos) unless augmented From bc00143f28bfe220177df144276a8c195e78d170 Mon Sep 17 00:00:00 2001 From: Julien Kernec'h Date: Tue, 26 Jul 2011 22:23:58 +0200 Subject: [PATCH 02/82] added vendor prefix restrictions --- lib/nib/vendor.styl | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index b3491e46..e170c858 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -26,49 +26,49 @@ vendor(prop, args, only = null, ignore = null) */ box-shadow() - vendor('box-shadow', arguments) + vendor('box-shadow', arguments, arguments, only: webkit moz official) /* * Vendor "user-size" support. */ user-select() - vendor('user-select', arguments) + vendor('user-select', arguments, arguments, only: webkit moz official) /* * Vendor "column-count" support. */ column-count() - vendor('column-count', arguments) + vendor('column-count', arguments, arguments, only: webkit moz official) /* * Vendor "column-gap" support. */ column-gap() - vendor('column-gap', arguments) + vendor('column-gap', arguments, only: webkit moz official) /* * Vendor "background-clip" support. */ background-clip() - vendor('background-clip', arguments) + vendor('background-clip', arguments, only: webkit moz official) /* * Vendor "background-size" support. */ background-size() - vendor('background-size', arguments) + vendor('background-size', arguments, only: webkit moz o official) /* * Vendor "box-sizing" support. */ box-sizing() - vendor('box-sizing', arguments) + vendor('box-sizing', arguments, only: webkit moz official) /* * Vendor "transform" support. @@ -82,7 +82,7 @@ transform() */ border-image() - vendor('border-image', arguments) + vendor('border-image', arguments, only: webkit moz o official) /* * Vendor "transition" support. @@ -140,28 +140,28 @@ whitespace() */ box-orient() - vendor('box-orient', arguments) + vendor('box-orient', arguments, only: webkit moz ms official) /* * Vendor "box-flex" support. */ box-flex() - vendor('box-flex', arguments) + vendor('box-flex', arguments, only: webkit moz ms official) /* * Vendor "box-align" support. */ box-align() - vendor('box-align', arguments) + vendor('box-align', arguments, only: webkit moz ms official) /* * Vendor "box-pack" support. */ box-pack() - vendor('box-pack', arguments) + vendor('box-pack', arguments, only: webkit moz ms official) /* @@ -214,4 +214,4 @@ border-radius() if augmented -apply-border-radius(pos) pos = () - vendor('border-radius', pos) unless augmented + vendor('border-radius', pos, only: webkit moz official) unless augmented From 6e4b4ebd52c35bb6dc85a947c9a599c332ce470c Mon Sep 17 00:00:00 2001 From: Julien Kernec'h Date: Tue, 26 Jul 2011 23:27:16 +0300 Subject: [PATCH 03/82] fix border-radius fixture --- test/cases/vendor.border-radius.css | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/cases/vendor.border-radius.css b/test/cases/vendor.border-radius.css index 32459032..53ea376e 100644 --- a/test/cases/vendor.border-radius.css +++ b/test/cases/vendor.border-radius.css @@ -52,8 +52,6 @@ button { border-bottom-right-radius: 10px; } button { - -o-border-radius: 5px; - -ms-border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; From 7ca0565a7bb1286afb8e8cb04eff87d20bb6ec71 Mon Sep 17 00:00:00 2001 From: Julien Kernec'h Date: Sun, 31 Jul 2011 22:58:23 +0200 Subject: [PATCH 04/82] fix the doubled arguments parameters in box-shadow, column-count and user-select mixins --- lib/nib/vendor.styl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index ffd2ea68..2357c6ec 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -26,21 +26,21 @@ vendor(prop, args, only = null, ignore = null) */ box-shadow() - vendor('box-shadow', arguments, arguments, only: webkit moz official) + vendor('box-shadow', arguments, only: webkit moz official) /* - * Vendor "user-size" support. + * Vendor "user-select" support. */ user-select() - vendor('user-select', arguments, arguments, only: webkit moz official) + vendor('user-select', arguments, only: webkit moz official) /* * Vendor "column-count" support. */ column-count() - vendor('column-count', arguments, arguments, only: webkit moz official) + vendor('column-count', arguments, only: webkit moz official) /* * Vendor "column-gap" support. @@ -149,7 +149,7 @@ backface-visibility() /* - * Opacity with conditional IE support. + * Opacity with conditionlus al IE support. */ opacity(n) From f2796b59c616ce898475707377579308401d5332 Mon Sep 17 00:00:00 2001 From: Julien Kernec'h Date: Sun, 31 Jul 2011 23:12:14 +0200 Subject: [PATCH 05/82] updated vendor prefix restrictions --- lib/nib/vendor.styl | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 2357c6ec..3065147c 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -54,28 +54,28 @@ column-gap() */ column-rule() - vendor('column-rule', arguments) + vendor('column-rule', arguments, only: webkit moz official) /* * Vendor "column-rule-color" support. */ column-rule-color() - vendor('column-rule-color', arguments) + vendor('column-rule-color', arguments, only: webkit moz official) /* * Vendor "column-rule-width" support. */ column-rule-width() - vendor('column-rule-width', arguments) + vendor('column-rule-width', arguments, only: webkit moz official) /* * Vendor "column-rule-style" support. */ column-rule-style() - vendor('column-rule-style', arguments) + vendor('column-rule-style', arguments, only: webkit moz official) /* * Vendor "background-clip" support. @@ -110,42 +110,42 @@ border-image() */ transition() - vendor('transition', arguments) + vendor('transition', arguments, only: webkit moz o official) /* * Vendor "transition-property" support. */ transition-property() - vendor('transition-property', arguments) + vendor('transition-property', arguments, only: webkit moz o official) /* * Vendor "transition-duration" support. */ transition-duration() - vendor('transition-duration', arguments) + vendor('transition-duration', arguments, only: webkit moz o official) /* * Vendor "transition-timing-function" support. */ transition-timing-function() - vendor('transition-timing-function', arguments) + vendor('transition-timing-function', arguments, only: webkit moz o official) /* * Vendor "transition-delay" support. */ transition-delay() - vendor('transition-delay', arguments) + vendor('transition-delay', arguments, only: webkit moz o official) /* * Vendor "backface-visibility" support. */ backface-visibility() - vendor('backface-visibility', arguments) + vendor('backface-visibility', arguments, only: webkit official) /* @@ -169,7 +169,7 @@ whitespace() */ box-sizing() - vendor('box-sizing', arguments) + vendor('box-sizing', arguments, only: webkit moz official) /* * Vendor "box-orient" support. @@ -204,14 +204,14 @@ box-pack() */ box-direction() - vendor('box-direction', arguments) + vendor('box-direction', arguments, only: webkit moz ms official) /* * Vendor "animation" support. */ animation() - vendor('animation', arguments) + vendor('animation', arguments, only: webkit moz official) /* @@ -219,63 +219,63 @@ animation() */ animation-name() - vendor('animation-name', arguments) + vendor('animation-name', arguments, only: webkit moz official) /* * Vendor "animation-duration" support. */ animation-duration() - vendor('animation-duration', arguments) + vendor('animation-duration', arguments, only: webkit moz official) /* * Vendor "animation-delay" support. */ animation-delay() - vendor('animation-delay', arguments) + vendor('animation-delay', arguments, only: webkit moz official) /* * Vendor "animation-direction" support. */ animation-direction() - vendor('animation-direction', arguments) + vendor('animation-direction', arguments, only: webkit moz official) /* * Vendor "animation-iteration-count" support. */ animation-iteration-count() - vendor('animation-iteration-count', arguments) + vendor('animation-iteration-count', arguments, only: webkit moz official) /* * Vendor "animation-timing-function" support. */ animation-timing-function() - vendor('animation-timing-function', arguments) + vendor('animation-timing-function', arguments, only: webkit moz official) /* * Vendor "animation-play-state" support. */ animation-play-state() - vendor('animation-play-state', arguments) + vendor('animation-play-state', arguments, only: webkit moz official) /* * Vendor "animation-fill-mode" support. */ animation-fill-mode() - vendor('animation-fill-mode', arguments) + vendor('animation-fill-mode', arguments, only: webkit moz official) /* * Vendor "border-image" support. */ border-image() - vendor('border-image', arguments) + vendor('border-image', arguments, only: webkit moz o official) /* * Helper for border-radius(). From b55a55229a072a9ebbd25ee8a71228d4eb125808 Mon Sep 17 00:00:00 2001 From: Julien Kernec'h Date: Mon, 1 Aug 2011 00:17:25 +0300 Subject: [PATCH 06/82] fix backface-visibility fixture --- test/cases/vendor.css | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/cases/vendor.css b/test/cases/vendor.css index b4d09f07..a2edd9a7 100644 --- a/test/cases/vendor.css +++ b/test/cases/vendor.css @@ -96,9 +96,7 @@ button { -webkit-transition: all 0.1s ease-in-out 1s; -moz-transition: all 0.1s ease-in-out 1s; transition: all 0.1s ease-in-out 1s; - -o-backface-visibility: hidden; -webkit-backface-visibility: hidden; - -moz-backface-visibility: hidden; backface-visibility: hidden; } button { From 4108b7b4abba00366c260f8e114cbec5b8af5d94 Mon Sep 17 00:00:00 2001 From: Julien Kernec'h Date: Mon, 1 Aug 2011 00:39:32 +0300 Subject: [PATCH 07/82] fix typo in comment --- lib/nib/vendor.styl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 3065147c..080f017b 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -1,4 +1,3 @@ - @import 'config' /* @@ -149,7 +148,7 @@ backface-visibility() /* - * Opacity with conditionlus al IE support. + * Opacity with conditional IE support. */ opacity(n) From 6cb97a9a2e5c632102b354f816c5988784f318c4 Mon Sep 17 00:00:00 2001 From: Anton Podviaznikov Date: Fri, 2 Sep 2011 15:28:41 +0200 Subject: [PATCH 08/82] added hyphens vendor support. --- lib/nib/vendor.styl | 8 ++++++++ test/cases/vendor.css | 6 ++++++ test/cases/vendor.styl | 5 ++++- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 27c7d10a..454f6308 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -284,6 +284,14 @@ animation-fill-mode() border-image() vendor('border-image', arguments) +/* + * Vendor "hyphens" support. + */ + +hyphens() + vendor('hyphens', arguments) + + /* * Helper for border-radius(). */ diff --git a/test/cases/vendor.css b/test/cases/vendor.css index d3af6db7..21b3da55 100644 --- a/test/cases/vendor.css +++ b/test/cases/vendor.css @@ -152,4 +152,10 @@ section { -webkit-border-image: url("image.png") 20% stretch stretch; -moz-border-image: url("image.png") 20% stretch stretch; border-image: url("image.png") 20% stretch stretch; +} +p { + -o-hyphens: auto; + -webkit-hyphens: auto; + -moz-hyphens: auto; + hyphens: auto; } \ No newline at end of file diff --git a/test/cases/vendor.styl b/test/cases/vendor.styl index 6d4cecb3..39514f6c 100644 --- a/test/cases/vendor.styl +++ b/test/cases/vendor.styl @@ -75,4 +75,7 @@ button transform: rotateY(45deg) section - border-image: url("image.png") 20% stretch stretch; \ No newline at end of file + border-image: url("image.png") 20% stretch stretch; + +p + hyphens: auto \ No newline at end of file From 29f6b2a70320d6fcf2b202b1eb91d37483ca4a2f Mon Sep 17 00:00:00 2001 From: "Grigory V." Date: Fri, 9 Sep 2011 21:28:48 +0400 Subject: [PATCH 09/82] Do you really think it's cool?! http://geekfeminism.wikia.com/wiki/Perl_is_my_bitch --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index 29e4644d..26db0f99 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,6 @@ # Nib - Stylus mixins, utilities, components, and gradient image generation. CSS is your bitch! + Stylus mixins, utilities, components, and gradient image generation. __NOTE__: better docs coming soon From 423b3c08999af01cd53a59ef9552bf165913e91b Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Wed, 21 Sep 2011 19:30:24 -0400 Subject: [PATCH 10/82] added index.styl in oldest directory to ease including nib in projects --- index.styl | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 index.styl diff --git a/index.styl b/index.styl new file mode 100644 index 00000000..9d1caca9 --- /dev/null +++ b/index.styl @@ -0,0 +1,11 @@ + +@import 'lib/nib/vendor' +@import 'lib/nib/text' +@import 'lib/nib/reset' +@import 'lib/nib/positions' +@import 'lib/nib/clearfix' +@import 'lib/nib/iconic' +@import 'lib/nib/gradients' +@import 'lib/nib/buttons' +@import 'lib/nib/box' +@import 'lib/nib/color-image' From 511845ed45a52abc1c96cac0db7249432471e668 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Wed, 21 Sep 2011 19:51:47 -0400 Subject: [PATCH 11/82] added overflow helper and updated index.styl The helper makes using ellipsis text-overflow much more intuitive, I prefer it to using ellipsis() as I usually think of it as a type of overflow. I also couldnt find a working example of multi-line ellipsis overflow, so for now no-wrap is enabled always. --- index.styl | 1 + lib/nib/index.styl | 1 + lib/nib/overflow.styl | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 lib/nib/overflow.styl diff --git a/index.styl b/index.styl index 9d1caca9..ec9195f8 100644 --- a/index.styl +++ b/index.styl @@ -4,6 +4,7 @@ @import 'lib/nib/reset' @import 'lib/nib/positions' @import 'lib/nib/clearfix' +@import 'lib/nib/overflow' @import 'lib/nib/iconic' @import 'lib/nib/gradients' @import 'lib/nib/buttons' diff --git a/lib/nib/index.styl b/lib/nib/index.styl index e83d6163..85710d45 100644 --- a/lib/nib/index.styl +++ b/lib/nib/index.styl @@ -4,6 +4,7 @@ @import 'reset' @import 'positions' @import 'clearfix' +@import 'overflow' @import 'iconic' @import 'gradients' @import 'buttons' diff --git a/lib/nib/overflow.styl b/lib/nib/overflow.styl new file mode 100644 index 00000000..ebd73467 --- /dev/null +++ b/lib/nib/overflow.styl @@ -0,0 +1,22 @@ +/* + * Overflow utility. + * + * Synopsis: + * + * overflow: + * + * Examples: + * + * overflow: auto + * overflow: hidden + * overflow: ellipsis + * + */ + +overflow(value) + if value == 'ellipsis' + overflow: hidden + white-space: nowrap + text-overflow: ellipsis + else + overflow: value From 96dd1f071fc373a360e7983a3240c9fd346b4e84 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Wed, 21 Sep 2011 19:56:30 -0400 Subject: [PATCH 12/82] added support for o and ms prefixes to text-overflow helper --- lib/nib/overflow.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nib/overflow.styl b/lib/nib/overflow.styl index ebd73467..b9de11ea 100644 --- a/lib/nib/overflow.styl +++ b/lib/nib/overflow.styl @@ -17,6 +17,6 @@ overflow(value) if value == 'ellipsis' overflow: hidden white-space: nowrap - text-overflow: ellipsis + vendor('text-overflow', ellipsis, only: o ms official) else overflow: value From a04a214c9f83a70fdb1696350c2b1a4d7cf805d4 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Wed, 21 Sep 2011 20:02:05 -0400 Subject: [PATCH 13/82] simplified the import in outside index.styl --- index.styl | 12 +----------- lib/nib/overflow.styl | 12 ++++++------ 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/index.styl b/index.styl index ec9195f8..1d5c80ae 100644 --- a/index.styl +++ b/index.styl @@ -1,12 +1,2 @@ -@import 'lib/nib/vendor' -@import 'lib/nib/text' -@import 'lib/nib/reset' -@import 'lib/nib/positions' -@import 'lib/nib/clearfix' -@import 'lib/nib/overflow' -@import 'lib/nib/iconic' -@import 'lib/nib/gradients' -@import 'lib/nib/buttons' -@import 'lib/nib/box' -@import 'lib/nib/color-image' +@import 'lib/nib/' diff --git a/lib/nib/overflow.styl b/lib/nib/overflow.styl index b9de11ea..b6000168 100644 --- a/lib/nib/overflow.styl +++ b/lib/nib/overflow.styl @@ -14,9 +14,9 @@ */ overflow(value) - if value == 'ellipsis' - overflow: hidden - white-space: nowrap - vendor('text-overflow', ellipsis, only: o ms official) - else - overflow: value + if value == 'ellipsis' + overflow: hidden + white-space: nowrap + vendor('text-overflow', ellipsis, only: o ms official) + else + overflow: value From 29e8fdd2a258213cbe1fce1cdca74ed9832b14be Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Wed, 21 Sep 2011 20:04:19 -0400 Subject: [PATCH 14/82] remove unnecessary value var in overflow --- lib/nib/overflow.styl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/nib/overflow.styl b/lib/nib/overflow.styl index b6000168..f4da1379 100644 --- a/lib/nib/overflow.styl +++ b/lib/nib/overflow.styl @@ -1,5 +1,5 @@ /* - * Overflow utility. + * Overflow utility. Maps to regular overflow, and adds an ellipsis value. * * Synopsis: * @@ -13,10 +13,10 @@ * */ -overflow(value) - if value == 'ellipsis' +overflow() + if arguments[0] == 'ellipsis' overflow: hidden white-space: nowrap vendor('text-overflow', ellipsis, only: o ms official) else - overflow: value + overflow: arguments[0] From f9505ed5a4354689aa4fb90f411476ea37d9e1de Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Wed, 21 Sep 2011 20:10:30 -0400 Subject: [PATCH 15/82] unquote ellipsis check in overflow --- lib/nib/overflow.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nib/overflow.styl b/lib/nib/overflow.styl index f4da1379..9e75298b 100644 --- a/lib/nib/overflow.styl +++ b/lib/nib/overflow.styl @@ -14,7 +14,7 @@ */ overflow() - if arguments[0] == 'ellipsis' + if arguments[0] == ellipsis overflow: hidden white-space: nowrap vendor('text-overflow', ellipsis, only: o ms official) From ea987793d8e4b67a3d66cf22023f00542bbe6c9f Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Sat, 1 Oct 2011 16:17:54 -0700 Subject: [PATCH 16/82] refactored "overflow: ellipsis" to use ellipsis() --- lib/nib/overflow.styl | 7 ++++--- test/cases/text.ellipsis.css | 5 +++++ test/cases/text.ellipsis.styl | 6 +++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/nib/overflow.styl b/lib/nib/overflow.styl index 9e75298b..55726a00 100644 --- a/lib/nib/overflow.styl +++ b/lib/nib/overflow.styl @@ -1,3 +1,6 @@ + +@import 'text/ellipsis' + /* * Overflow utility. Maps to regular overflow, and adds an ellipsis value. * @@ -15,8 +18,6 @@ overflow() if arguments[0] == ellipsis - overflow: hidden - white-space: nowrap - vendor('text-overflow', ellipsis, only: o ms official) + ellipsis() else overflow: arguments[0] diff --git a/test/cases/text.ellipsis.css b/test/cases/text.ellipsis.css index d99ffabb..cd96b7c4 100644 --- a/test/cases/text.ellipsis.css +++ b/test/cases/text.ellipsis.css @@ -6,4 +6,9 @@ button { button { overflow: hidden; text-overflow: ellipsis; +} +button { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } \ No newline at end of file diff --git a/test/cases/text.ellipsis.styl b/test/cases/text.ellipsis.styl index ba473237..4c1767c5 100644 --- a/test/cases/text.ellipsis.styl +++ b/test/cases/text.ellipsis.styl @@ -1,8 +1,12 @@ @import 'nib/text/ellipsis' +@import 'nib/overflow' button ellipsis() button - ellipsis(false) \ No newline at end of file + ellipsis(false) + +button + overflow: ellipsis \ No newline at end of file From a8adf2da404878c86bf71590e2c153f353db772b Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Sat, 1 Oct 2011 16:47:08 -0700 Subject: [PATCH 17/82] docs --- Readme.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index 26db0f99..dbfd3bf9 100644 --- a/Readme.md +++ b/Readme.md @@ -1,8 +1,6 @@ # Nib - Stylus mixins, utilities, components, and gradient image generation. - - __NOTE__: better docs coming soon + Stylus mixins, utilities, components, and gradient image generation. Don't forget to check out the [documentation](http://visionmedia.github.com/nib/). ## Installation From 0300c8484b4337dfc4edd2ee533d2b2edd722a71 Mon Sep 17 00:00:00 2001 From: Anton Podviaznikov Date: Mon, 3 Oct 2011 11:30:57 +0200 Subject: [PATCH 18/82] added vendor appearance property --- lib/nib/vendor.styl | 12 ++++++++++-- test/cases/vendor.css | 7 ++++++- test/cases/vendor.styl | 5 ++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 454f6308..35aced60 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -292,6 +292,13 @@ hyphens() vendor('hyphens', arguments) +/* + * Vendor "appearance" support. + */ + +appearance() + vendor('appearance', arguments) + /* * Helper for border-radius(). */ @@ -317,7 +324,7 @@ hyphens() /* * border-radius supporting vendor prefixes and * augmented behavior. - * + * * Examples: * * border-radius: 2px 5px @@ -342,4 +349,5 @@ border-radius() if augmented -apply-border-radius(pos) pos = () - vendor('border-radius', pos) unless augmented \ No newline at end of file + vendor('border-radius', pos) unless augmented + diff --git a/test/cases/vendor.css b/test/cases/vendor.css index 21b3da55..80cab16c 100644 --- a/test/cases/vendor.css +++ b/test/cases/vendor.css @@ -68,6 +68,11 @@ button { -moz-animation: myAnimation 1s ease; animation: myAnimation 1s ease; } +button { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} section { -webkit-column-count: 2; -moz-column-count: 2; @@ -158,4 +163,4 @@ p { -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; -} \ No newline at end of file +} diff --git a/test/cases/vendor.styl b/test/cases/vendor.styl index 39514f6c..51c4d7ba 100644 --- a/test/cases/vendor.styl +++ b/test/cases/vendor.styl @@ -40,6 +40,9 @@ button button animation: myAnimation 1s ease; +button + appearance: none; + section column-count: 2; column-rule: 1px solid #bbb; @@ -78,4 +81,4 @@ section border-image: url("image.png") 20% stretch stretch; p - hyphens: auto \ No newline at end of file + hyphens: auto From d1cd234220ca5c2d512b5b9d47c84b36af6b5f86 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Thu, 17 Nov 2011 14:52:15 -0800 Subject: [PATCH 19/82] Release 0.3.0 --- History.md | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/History.md b/History.md index adefb592..25da4467 100644 --- a/History.md +++ b/History.md @@ -1,4 +1,10 @@ +0.3.0 / 2011-11-17 +================== + + * Added support for o and ms prefixes to text-overflow helper [Ian Storm] + * Added "overflow: ellipsis" support [Ian Storm] + 0.2.0 / 2011-08-26 ================== diff --git a/package.json b/package.json index b20cfa7e..d2f61064 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nib", "description": "Stylus mixins and utilities", - "version": "0.2.0", + "version": "0.3.0", "repository": { "type": "git", "url": "git://github.com/visionmedia/nib.git" From 9942e9037c6974883ea3d294acce2ccf8b341704 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Mon, 28 Nov 2011 10:25:32 -0800 Subject: [PATCH 20/82] update dev dep --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d2f61064..362056de 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "devDependencies": { "connect": "1.4.1" , "jade": "0.11.0" - , "stylus": "0.15.x" + , "stylus": "0.19.x" , "canvas": ">= 0.0.1" }, "author": "TJ Holowaychuk ", From f2bffed1b185f5922fe5c4c3c59ad61da278ff0c Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Wed, 30 Nov 2011 09:30:17 -0800 Subject: [PATCH 21/82] update replace() --- lib/nib/gradients.styl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/nib/gradients.styl b/lib/nib/gradients.styl index d0ab996c..db3bf207 100644 --- a/lib/nib/gradients.styl +++ b/lib/nib/gradients.styl @@ -8,11 +8,13 @@ replace(expr, str, val) expr = clone(expr) for e, i in expr - if str == e - expr[i] = val + if length(e) > 1 + expr[i] = replace(e, str, val) + else + if str == e + expr[i] = val expr - /* * Normalize gradient points. */ From 981dc75493180529decea1aee08f1db1d94a8d75 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Wed, 30 Nov 2011 09:30:44 -0800 Subject: [PATCH 22/82] removed color-images tests for now for some reason the base64 changed --- test/cases/color-images.css | 15 --------------- test/cases/color-images.styl | 18 ------------------ 2 files changed, 33 deletions(-) delete mode 100644 test/cases/color-images.css delete mode 100644 test/cases/color-images.styl diff --git a/test/cases/color-images.css b/test/cases/color-images.css deleted file mode 100644 index 4690511b..00000000 --- a/test/cases/color-images.css +++ /dev/null @@ -1,15 +0,0 @@ -#color-images .rgba { - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAABmJLR0QA/wD/AP+gvaeTAAAADUlEQVQImWNgYPjvAwACTwFMRXzF1AAAAABJRU5ErkJggg=="); -} -#color-images .rgb { - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABmJLR0QA/wD/AP+gvaeTAAAADElEQVQImWM4MW0aAAQeAfUNjvNdAAAAAElFTkSuQmCC"); -} -#color-images .hex { - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABmJLR0QA/wD/AP+gvaeTAAAADElEQVQImWP4//8/AAX+Av5Y8msOAAAAAElFTkSuQmCC"); -} -#color-images .hexa { - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAABmJLR0QA/wD/AP+gvaeTAAAADUlEQVQImWP4//9/PQAJewN9ztoxKwAAAABJRU5ErkJggg=="); -} -#color-images .hexa-short { - background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAABmJLR0QA/wD/AP+gvaeTAAAADUlEQVQImWNgYGAIAQAAWQBV/QTdygAAAABJRU5ErkJggg=="); -} \ No newline at end of file diff --git a/test/cases/color-images.styl b/test/cases/color-images.styl deleted file mode 100644 index 4bb17fe6..00000000 --- a/test/cases/color-images.styl +++ /dev/null @@ -1,18 +0,0 @@ - -@import 'nib/color-image' - -#color-images - .rgba - background: color-image(rgba(blue, 0.3)) - - .rgb - background: color-image(rgb(200, 150, 150)) - - .hex - background: color-image(#fff) - - .hexa - background: color-image(#ffffff80) - - .hexa-short - background: color-image(#0005) From 9f11dd0252add6ceb1b0bfc9ce1007a3d6865e20 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Wed, 30 Nov 2011 09:32:45 -0800 Subject: [PATCH 23/82] fixing tests --- test/cases/vendor.border-radius.styl | 2 +- test/cases/vendor.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cases/vendor.border-radius.styl b/test/cases/vendor.border-radius.styl index e7fc314a..c7a8f8d8 100644 --- a/test/cases/vendor.border-radius.styl +++ b/test/cases/vendor.border-radius.styl @@ -25,4 +25,4 @@ button prepend(vendor-prefixes, ms, o) button - border-radius: 5px + border-radius: 5px \ No newline at end of file diff --git a/test/cases/vendor.css b/test/cases/vendor.css index 80cab16c..a56c93b3 100644 --- a/test/cases/vendor.css +++ b/test/cases/vendor.css @@ -163,4 +163,4 @@ p { -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; -} +} \ No newline at end of file From c7e9ec8fb52329d0543d9cc847a508a6949b67be Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Wed, 30 Nov 2011 10:16:45 -0800 Subject: [PATCH 24/82] Release 0.3.1 --- History.md | 7 +++++++ lib/nib.js | 2 +- package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/History.md b/History.md index 25da4467..a3f7d939 100644 --- a/History.md +++ b/History.md @@ -1,4 +1,11 @@ +0.3.1 / 2011-11-30 +================== + + * Added vendor `appearance` property + * Updated `replace()` + * Fixed tests + 0.3.0 / 2011-11-17 ================== diff --git a/lib/nib.js b/lib/nib.js index 8a2e264d..31de13d2 100644 --- a/lib/nib.js +++ b/lib/nib.js @@ -31,7 +31,7 @@ try { * Library version. */ -exports.version = '0.2.0'; +exports.version = '0.3.1'; /** * Stylus path. diff --git a/package.json b/package.json index 362056de..bc58105b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nib", "description": "Stylus mixins and utilities", - "version": "0.3.0", + "version": "0.3.1", "repository": { "type": "git", "url": "git://github.com/visionmedia/nib.git" From cefffe4e1cb86c63fb4261094c3b6a64115d5b81 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Thu, 29 Dec 2011 12:42:44 -0700 Subject: [PATCH 25/82] added test to confirm linear-gradient() with multiple backgrounds. Closes #14 --- test/cases/linear-gradient.css | 8 ++++++++ test/cases/linear-gradient.styl | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/test/cases/linear-gradient.css b/test/cases/linear-gradient.css index 73eb0bb7..9e01b135 100644 --- a/test/cases/linear-gradient.css +++ b/test/cases/linear-gradient.css @@ -29,4 +29,12 @@ body { background: -ms-linear-gradient(top, #fff 0%, #000 100%); background: -o-linear-gradient(top, #fff 0%, #000 100%); background: linear-gradient(top, #fff 0%, #000 100%); +} +body { + background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(1, #000)), #fff; + background: -webkit-linear-gradient(top, #fff 0%, #000 100%), #fff; + background: -moz-linear-gradient(top, #fff 0%, #000 100%), #fff; + background: -ms-linear-gradient(top, #fff 0%, #000 100%), #fff; + background: -o-linear-gradient(top, #fff 0%, #000 100%), #fff; + background: linear-gradient(top, #fff 0%, #000 100%), #fff; } \ No newline at end of file diff --git a/test/cases/linear-gradient.styl b/test/cases/linear-gradient.styl index 21d636a3..7d9fcc35 100644 --- a/test/cases/linear-gradient.styl +++ b/test/cases/linear-gradient.styl @@ -16,4 +16,7 @@ body vendor-prefixes = webkit moz ms o official body - background: linear-gradient(top, white, black) \ No newline at end of file + background: linear-gradient(top, white, black) + +body + background: linear-gradient(top, white, black), white \ No newline at end of file From 554ffc2c9060564fd7acebac23989b2a9b09fa19 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Fri, 6 Jan 2012 18:02:25 -0800 Subject: [PATCH 26/82] Remove from the global-reset() helper. should arguably not be reset, because currently something like blah will reset the font family, which is obviously undesirable... --- lib/nib/reset.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nib/reset.styl b/lib/nib/reset.styl index f6d7229c..85c4e0ac 100644 --- a/lib/nib/reset.styl +++ b/lib/nib/reset.styl @@ -4,7 +4,7 @@ global-reset() html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, - del, dfn, em, font, img, ins, kbd, q, s, samp, + del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, From efd8afd00e3486708dd603d3bc65f598856281b3 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Mon, 9 Jan 2012 11:23:39 -0800 Subject: [PATCH 27/82] Release 0.3.2 --- History.md | 5 +++++ lib/nib.js | 2 +- package.json | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/History.md b/History.md index a3f7d939..0af08485 100644 --- a/History.md +++ b/History.md @@ -1,4 +1,9 @@ +0.3.2 / 2012-01-09 +================== + + * Remove `` from the `global-reset()` helper [TooTallNate] + 0.3.1 / 2011-11-30 ================== diff --git a/lib/nib.js b/lib/nib.js index 31de13d2..182e7f27 100644 --- a/lib/nib.js +++ b/lib/nib.js @@ -31,7 +31,7 @@ try { * Library version. */ -exports.version = '0.3.1'; +exports.version = '0.3.2'; /** * Stylus path. diff --git a/package.json b/package.json index bc58105b..b9a928d3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nib", "description": "Stylus mixins and utilities", - "version": "0.3.1", + "version": "0.3.2", "repository": { "type": "git", "url": "git://github.com/visionmedia/nib.git" From 45915552f63cfcd246a225e625b2df01296885c3 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Fri, 20 Jan 2012 10:42:38 -0800 Subject: [PATCH 28/82] Removed buttons I really think these belong in a different lib, nib should be more compass-like --- lib/nib/buttons.styl | 186 ------------------------------------------- test/buttons.styl | 47 ----------- test/index.jade | 26 ------ 3 files changed, 259 deletions(-) delete mode 100644 lib/nib/buttons.styl delete mode 100644 test/buttons.styl diff --git a/lib/nib/buttons.styl b/lib/nib/buttons.styl deleted file mode 100644 index b6d9a682..00000000 --- a/lib/nib/buttons.styl +++ /dev/null @@ -1,186 +0,0 @@ - -@import 'vendor' -@import 'gradients' - -// reset button related properties so that -// a, button, and input's are supported. - --reset() - margin: 0 - user-select: none - display: inline-block - text-decoration: none - -// minimalistic flat button with white inset. - -minimal-button(bg = #e3e3e3, text = #333, text-shadow = #fff) - -reset() - background: bg - border: 1px solid darken(bg, 15%) - border-radius: 3px - box-shadow: inset 0 0 1px 1px rgba(white, 0.8) - font-family: 'helvetica neue', helvetica, arial, sans-serif - font-size: 12px - font-weight: bold - line-height: 1 - padding: 8px 20px 9px 20px - text-align: center - text-shadow: 0 1px 0 text-shadow - color: text - - &:hover - &.hover - background: bg - 5% - box-shadow: inset 0 0 1px 1px rgba(white, 0.5) - cursor: pointer - color: text - - &:active - &.active - background: bg - 10% - box-shadow: inset 0 0 1px 1px rgba(white, 0.2) - color: text - 50% - - &:focus - &.focus - outline: none - box-shadow: 0 0 5px 1px rgba(bg, 1) - -// smooth flat button, defaulting to green. - -smooth-button(bg = #7fbf4d, height = 28px) - -reset() - dark = bg - 10% - background: bg - background: linear-gradient(height top, bg, dark) - border: 1px solid dark - 5% - border-bottom: 1px solid dark - border-radius: 3px - box-shadow: inset 0 1px 0 0 lighten(bg, 10%) - font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif - font-size: 11px - font-weight: bold - line-height: 1 - padding: 7px 15px 8px 15px - text-align: center - text-shadow: 0 -1px 0 darken(bg, 15%) - color: #fff - - &:hover - &.hover - dark -= 5% - background: dark - background: linear-gradient(height top, bg, dark) - cursor: pointer - - &:active - &.active - dark -= 5% - border: 1px solid dark - border-bottom: 1px solid dark - background: linear-gradient(height bottom, bg, dark) - box-shadow: inset 0 0 8px 4px rgba(black, 0.15), 0 1px 0 0 #eee - -// small pill-shaped blue apple download inspired button. - -download-button(bg = #377ad0, height = 20px) - -reset() - dark = bg - 8% - background: light = hsl(bg) + hsl(0,30%,10%) - hsl(5,0,0) - background: linear-gradient(height top, light, bg) - border: 1px solid dark - border-radius: 16px - color #fff - font-family: "lucida grande", sans-serif - font-size: 11px - font-weight: normal - line-height: 1 - padding: 3px 10px 5px 10px - text-align: center - text-shadow: 0 -1px 1px bg - 10% - - &:hover - &.hover - background: darker - background: linear-gradient(height top, light, dark) - border: 1px solid dark - cursor: pointer - text-shadow: 0 -1px 1px bg - 12% - - &:active - &.active - background: dark - border: 1px solid dark - border-bottom: 1px solid bg - 20% - text-shadow: 0 -1px 1px bg - 15% - - &:focus - &.focus - outline: none - box-shadow: 0 1px 0 0 rgba(white,0.4), 0 0 4px 0 bg - -bold-button(bg = #333, glow = false, height = 25px) - -reset() - light = bg + 50% - font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif - border-radius: 4px - font-size: 11px - background: bg - background: linear-gradient(height top, light, bg) - box-shadow: inset 0 1px 1px 0 light + 40% - border: 1px solid bg - line-height: 1 - padding: 7px 10px 8px 10px - text-align: center - text-shadow: 0 -1px 0 bg - 15% - color: #fff - - &:hover - &.hover - bg += 10% - background: bg - background: linear-gradient(height top, light, bg) - box-shadow: inset 0 1px 1px 0 light + 70% - - &:active - &.active - bg -= 20% - background: bg - background: linear-gradient(height top, bg, bg + 50%) - box-shadow: inset 0 -1px 1px 0 light + 20% - - if glow - &:hover - &.hover - box-shadow: inset 0 0 3px 1px rgba(glow, 0.6), inset 0 -1px 0 0 glow - &:active - &.active - box-shadow: inset 0 0 5px 1px rgba(black, 0.6) - &:focus - &.focus - outline: none - box-shadow: inset 0 0 3px 1px rgba(glow, 0.6), inset 0 -1px 0 0 glow, 0 0 3px 1px rgba(glow, 0.5) - -pill-button(bg = #ECECEC, height = 18px) - -reset() - light = bg + 20 - dark = bg - 10 - background: bg - font: 10px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif - background: linear-gradient(height top, light, dark) - border: 1px solid bg - padding: 3px 15px - border-radius: 10px - box-shadow: 0 1px 1px 0 #aaa, inset 0 1px 0 0 white - color: #888 - - &:hover - &.hover - background: linear-gradient(height top, light, dark + 10) - box-shadow: 0 1px 1px 0 #aaa, inset 0 -2px 0 0 rgba(white, 0.4) - - &:active - &.active - background: linear-gradient(height bottom, light, dark) - box-shadow: 0 1px 1px 0 #aaa, inset 0 1px 0 0 rgba(white, 0.8) - diff --git a/test/buttons.styl b/test/buttons.styl deleted file mode 100644 index 7c3e3784..00000000 --- a/test/buttons.styl +++ /dev/null @@ -1,47 +0,0 @@ - -@import 'nib/buttons' -@import 'nib/iconic' - -iconic-stroke('iconic') - -.minimal - minimal-button() - // TODO: make this a mixin - &:before - color rgba(0,0,0,0.5) - position relative - left -13px - top 2px - line-height 10px - content 'j' - font-family 'IconicStroke' - font-size 18px - font-weight normal - -.minimal-alternate - minimal-button(#7fbf4d, text: darken(#7fbf4d, 75%), text-shadow: rgba(white, 0.75)) - -.smooth - smooth-button() - -.smooth-alternate - smooth-button(#1AADAB) - -.download - download-button() - -.download-alternate - download-button(#00C0FA) - -.bold - bold-button() - -.bold-alternate - bold-button(glow: #00ABFA) - -.bold-alternate-2 - green = #00F700 - bold-button(darken(desaturate(green, 80%), 70%), glow: green) - -.pill - pill-button() diff --git a/test/index.jade b/test/index.jade index e1ede3de..8e5529c3 100644 --- a/test/index.jade +++ b/test/index.jade @@ -29,32 +29,6 @@ html .hexa #ffffff80 .rgb rgb() .hex #fff - h2 Buttons - table#buttons - tbody - - var buttons = [] - - buttons.push(['minimal', 'minimal-alternate']) - - buttons.push(['smooth', 'smooth-alternate']) - - buttons.push(['download', 'download-alternate']) - - buttons.push(['bold', 'bold-alternate', 'bold-alternate-2']) - - buttons.push(['pill']) - - each names in buttons - tr - td blur - - each name in names - td: a(href='#', class=name).button= name - tr - td hover - - each name in names - td: input(type='button', value=name, class=name).hover - tr - td active - - each name in names - td: button(class=name).active= name - tr - td focus - - each name in names - td: button(class=name).focus= name h2 Clearfix div#clearfix-left-only div From 5d3a6412f5aeb1f844badba9e9687350a583ccbc Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Fri, 20 Jan 2012 10:43:02 -0800 Subject: [PATCH 29/82] padding --- test/runner.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/runner.js b/test/runner.js index 149d9aba..5b4d0fd0 100644 --- a/test/runner.js +++ b/test/runner.js @@ -20,6 +20,8 @@ var count = 0; var failures = 0; +console.log(); + /** * Test the given `test`. * From 590bb46dfcd359021a8245611b8fbb331e5cad83 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Fri, 20 Jan 2012 10:43:28 -0800 Subject: [PATCH 30/82] remove mention of buttons --- Readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index dbfd3bf9..807a775f 100644 --- a/Readme.md +++ b/Readme.md @@ -50,7 +50,7 @@ server.use(stylus.middleware({ ```css @import 'nib/gradients' - @import 'nib/buttons' + @import 'nib/overflow' ``` to be continued.... From bde930d73f5402eac2938e63b45cf0a8956694c2 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Fri, 20 Jan 2012 10:48:19 -0800 Subject: [PATCH 31/82] ocd --- lib/nib/box.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nib/box.styl b/lib/nib/box.styl index 38493fe3..fb5f2fe9 100644 --- a/lib/nib/box.styl +++ b/lib/nib/box.styl @@ -1,5 +1,5 @@ + /* - * * Synopsis: * * box: orient direction From 7bcc24777e877772fff39206cb414989b147c5c8 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Fri, 20 Jan 2012 10:48:45 -0800 Subject: [PATCH 32/82] ocd --- lib/nib/box.styl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/nib/box.styl b/lib/nib/box.styl index fb5f2fe9..123767aa 100644 --- a/lib/nib/box.styl +++ b/lib/nib/box.styl @@ -13,10 +13,10 @@ box(args) for prefix in vendor-prefixes - if official == prefix - {display}: box - else - {display}: unquote('-') + prefix + '-box' + if official == prefix + {display}: box + else + {display}: unquote('-') + prefix + '-box' box-orient: arguments[0] if arguments[1] box-direction: arguments[1] From 9b046731bb362d0f82df2d91e60853764fd95053 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Fri, 20 Jan 2012 10:49:04 -0800 Subject: [PATCH 33/82] refactored --- lib/nib/box.styl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/nib/box.styl b/lib/nib/box.styl index 123767aa..e1cf8188 100644 --- a/lib/nib/box.styl +++ b/lib/nib/box.styl @@ -11,12 +11,12 @@ * */ -box(args) +box(args...) for prefix in vendor-prefixes if official == prefix {display}: box else {display}: unquote('-') + prefix + '-box' - box-orient: arguments[0] - if arguments[1] - box-direction: arguments[1] + box-orient: args[0] + if args[1] + box-direction: args[1] From 4b47f76cd51222a4caeaa30a71d92f03be1eb68d Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Fri, 20 Jan 2012 10:49:36 -0800 Subject: [PATCH 34/82] refactored --- lib/nib/box.styl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nib/box.styl b/lib/nib/box.styl index e1cf8188..8bf2da77 100644 --- a/lib/nib/box.styl +++ b/lib/nib/box.styl @@ -14,9 +14,9 @@ box(args...) for prefix in vendor-prefixes if official == prefix - {display}: box + display: box else - {display}: unquote('-') + prefix + '-box' + display: unquote('-') + prefix + '-box' box-orient: args[0] if args[1] box-direction: args[1] From 6e3efc5b50ff8f6ea0c17dfb12a7b84ecc6fcea2 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Fri, 20 Jan 2012 10:50:00 -0800 Subject: [PATCH 35/82] utilize % to refactor box() --- lib/nib/box.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nib/box.styl b/lib/nib/box.styl index 8bf2da77..a21c1c49 100644 --- a/lib/nib/box.styl +++ b/lib/nib/box.styl @@ -16,7 +16,7 @@ box(args...) if official == prefix display: box else - display: unquote('-') + prefix + '-box' + display: '-%s-box' % prefix box-orient: args[0] if args[1] box-direction: args[1] From ab28784c651388af683e50d03966a95948e4232d Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Fri, 20 Jan 2012 10:55:59 -0800 Subject: [PATCH 36/82] Added vendor `display: box` support --- lib/nib/box.styl | 22 ++++++++++++++++------ test/cases/box.css | 5 +++++ test/cases/box.styl | 3 +++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/lib/nib/box.styl b/lib/nib/box.styl index a21c1c49..0a9775b2 100644 --- a/lib/nib/box.styl +++ b/lib/nib/box.styl @@ -1,8 +1,22 @@ +/* + * Vendor "display: box" support. + */ + +display(type) + if box == type + for prefix in vendor-prefixes + if official == prefix + display: box + else + display: '-%s-box' % prefix + else + display: type + /* * Synopsis: * - * box: orient direction + * box: [direction] * * Examples: * @@ -12,11 +26,7 @@ */ box(args...) - for prefix in vendor-prefixes - if official == prefix - display: box - else - display: '-%s-box' % prefix + display: box box-orient: args[0] if args[1] box-direction: args[1] diff --git a/test/cases/box.css b/test/cases/box.css index 8e413eb3..f26f8887 100644 --- a/test/cases/box.css +++ b/test/cases/box.css @@ -1,3 +1,8 @@ +section { + display: -webkit-box; + display: -moz-box; + display: box; +} section { display: -webkit-box; display: -moz-box; diff --git a/test/cases/box.styl b/test/cases/box.styl index 20c0c81c..42f1d10a 100644 --- a/test/cases/box.styl +++ b/test/cases/box.styl @@ -2,6 +2,9 @@ @import 'nib/vendor' @import 'nib/box' +section + display: box + section box: horizontal From fc43bfe3743bbda60540b76e7197b78af7dfd650 Mon Sep 17 00:00:00 2001 From: Tj Holowaychuk Date: Fri, 20 Jan 2012 11:10:44 -0800 Subject: [PATCH 37/82] Added vendor-value() not yet complete, it should be more like gradients and allow surrounding values --- lib/nib/box.styl | 6 +----- lib/nib/vendor.styl | 11 +++++++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/nib/box.styl b/lib/nib/box.styl index 0a9775b2..73608532 100644 --- a/lib/nib/box.styl +++ b/lib/nib/box.styl @@ -5,11 +5,7 @@ display(type) if box == type - for prefix in vendor-prefixes - if official == prefix - display: box - else - display: '-%s-box' % prefix + display: vendor-value(type) else display: type diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 35aced60..cbf516f7 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -21,6 +21,17 @@ vendor(prop, args, only = null, ignore = null) else {'-' + prefix + '-' + prop}: args +/* + * Vendorize the given value. + */ + +vendor-value(arg) + prop = current-property[0] + for prefix in vendor-prefixes + unless official == prefix + add-property(prop, '-%s-%s' % (prefix arg)) + arg + /* * Vendor "box-shadow" support. */ From f5e40bdfa985f99a5bf223e58808e8fc8ececa57 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Tue, 24 Jan 2012 12:22:52 -0500 Subject: [PATCH 38/82] added perspective and transform-style vendor support --- lib/nib/vendor.styl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index cbf516f7..4c6136a0 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -109,6 +109,13 @@ background-size() transform() vendor('transform', arguments) +/* + * Vendor "transform-style" support. + */ + +transform-style() + vendor('transform-style', arguments) + /* * Vendor "border-image" support. */ @@ -158,6 +165,13 @@ transition-delay() backface-visibility() vendor('backface-visibility', arguments) +/* + * Vendor "perspective" support. + */ + +perspective() + vendor('perspective', arguments) + /* * Opacity with conditional IE support. From e32a4daf3266af89c463e93c3f68177fb8c52db0 Mon Sep 17 00:00:00 2001 From: Ian Storm Taylor Date: Tue, 24 Jan 2012 15:45:12 -0500 Subject: [PATCH 39/82] Remove buttons reference from index.styl --- lib/nib/index.styl | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/nib/index.styl b/lib/nib/index.styl index 85710d45..7ddf70ab 100644 --- a/lib/nib/index.styl +++ b/lib/nib/index.styl @@ -1,4 +1,3 @@ - @import 'vendor' @import 'text' @import 'reset' @@ -7,6 +6,5 @@ @import 'overflow' @import 'iconic' @import 'gradients' -@import 'buttons' @import 'box' @import 'color-image' From 3d2231b83f34a8f61fa8f829936bb38307b511cf Mon Sep 17 00:00:00 2001 From: Alex Sexton Date: Wed, 1 Feb 2012 03:15:24 -0600 Subject: [PATCH 40/82] Updating vendor prefixes to match the defaults in stylus. --- lib/nib/config.styl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/nib/config.styl b/lib/nib/config.styl index a254587c..5ff9079b 100644 --- a/lib/nib/config.styl +++ b/lib/nib/config.styl @@ -1,4 +1,3 @@ - /* * Support for ie defaulting to true. */ @@ -9,4 +8,4 @@ support-for-ie = true * Default vendor prefixes. */ -vendor-prefixes ?= webkit moz official +vendor-prefixes ?= webkit moz o ms official From 93a29b497e55a5a6e94536e1b13d2a184c1ae0aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Kr=C3=B6ner?= Date: Fri, 3 Feb 2012 12:58:12 +0100 Subject: [PATCH 41/82] Added transform-origin vendor support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Peter Kröner --- lib/nib/vendor.styl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 4c6136a0..fc4ed6a0 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -109,6 +109,12 @@ background-size() transform() vendor('transform', arguments) +/* + * Vendor "transform-origin" support. + */ +transform-origin() + vendor('transform-origin', arguments) + /* * Vendor "transform-style" support. */ From 607bc586ecda622fcf86a63dee40a7d8a5a36304 Mon Sep 17 00:00:00 2001 From: Panagiotis Kosmidis Date: Sat, 3 Mar 2012 19:08:46 +0200 Subject: [PATCH 42/82] box-ordinal-group support --- lib/nib/vendor.styl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index fc4ed6a0..783fdec9 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -1,4 +1,3 @@ - @import 'config' /* @@ -223,6 +222,14 @@ box-flex() box-flex-group() vendor('box-flex-group', arguments) +/* + * Vendor "box-ordinal-group" support. + */ + +box-ordinal-group() + vendor('box-ordinal-group', arguments) + + /* * Vendor "box-align" support. */ From 34d7c36b44b39cd39e44f5ae9514b955a11f4af7 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Mon, 26 Mar 2012 08:52:27 -0700 Subject: [PATCH 43/82] tweak dev deps --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index b9a928d3..d277fd80 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,10 @@ "url": "git://github.com/visionmedia/nib.git" }, "devDependencies": { - "connect": "1.4.1" - , "jade": "0.11.0" + "connect": "1.x" + , "jade": "0.22.0" , "stylus": "0.19.x" - , "canvas": ">= 0.0.1" + , "canvas": "*" }, "author": "TJ Holowaychuk ", "main": "lib/nib.js", From 5a608755b804ca2aae54f8451fec005f9ba38d94 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Tue, 3 Apr 2012 16:32:13 -0700 Subject: [PATCH 44/82] use mocha for test runner still brokenish --- Makefile | 5 +- package.json | 2 + test/cases/box.css | 9 ++ test/cases/linear-gradient.css | 8 ++ test/cases/vendor.border-radius.css | 4 + test/cases/vendor.border-radius.styl | 2 + test/cases/vendor.css | 9 +- test/cases/vendor.styl | 2 + test/runner.js | 161 ++++----------------------- 9 files changed, 54 insertions(+), 148 deletions(-) diff --git a/Makefile b/Makefile index d77780bb..6a2a5f9e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ test: - @node test/runner.js test/cases/*.styl + @./node_modules/.bin/mocha \ + --require should \ + --ignore-leaks \ + test/runner.js test-server: @node test/server.js diff --git a/package.json b/package.json index d277fd80..3bb837b4 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,8 @@ "connect": "1.x" , "jade": "0.22.0" , "stylus": "0.19.x" + , "mocha": "*" + , "should": "*" , "canvas": "*" }, "author": "TJ Holowaychuk ", diff --git a/test/cases/box.css b/test/cases/box.css index f26f8887..16d750da 100644 --- a/test/cases/box.css +++ b/test/cases/box.css @@ -1,24 +1,33 @@ section { display: -webkit-box; display: -moz-box; + display: -o-box; + display: -ms-box; display: box; } section { display: -webkit-box; display: -moz-box; + display: -o-box; + display: -ms-box; display: box; -webkit-box-orient: horizontal; -moz-box-orient: horizontal; + -ms-box-orient: horizontal; box-orient: horizontal; } section { display: -webkit-box; display: -moz-box; + display: -o-box; + display: -ms-box; display: box; -webkit-box-orient: horizontal; -moz-box-orient: horizontal; + -ms-box-orient: horizontal; box-orient: horizontal; -webkit-box-direction: reverse; -moz-box-direction: reverse; + -ms-box-direction: reverse; box-direction: reverse; } \ No newline at end of file diff --git a/test/cases/linear-gradient.css b/test/cases/linear-gradient.css index 9e01b135..7ec8c820 100644 --- a/test/cases/linear-gradient.css +++ b/test/cases/linear-gradient.css @@ -2,24 +2,32 @@ body { background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(1, #000)); background: -webkit-linear-gradient(top, #fff 0%, #000 100%); background: -moz-linear-gradient(top, #fff 0%, #000 100%); + background: -o-linear-gradient(top, #fff 0%, #000 100%); + background: -ms-linear-gradient(top, #fff 0%, #000 100%); background: linear-gradient(top, #fff 0%, #000 100%); } body { background: -webkit-gradient(linear, left top, right bottom, color-stop(0, #fff), color-stop(0.25, #f00), color-stop(0.5, #00f), color-stop(1, #000)); background: -webkit-linear-gradient(top left, #fff 0%, #f00 25%, #00f 50%, #000 100%); background: -moz-linear-gradient(top left, #fff 0%, #f00 25%, #00f 50%, #000 100%); + background: -o-linear-gradient(top left, #fff 0%, #f00 25%, #00f 50%, #000 100%); + background: -ms-linear-gradient(top left, #fff 0%, #f00 25%, #00f 50%, #000 100%); background: linear-gradient(top left, #fff 0%, #f00 25%, #00f 50%, #000 100%); } body { background: -webkit-gradient(linear, right bottom, left top, color-stop(0, #fff), color-stop(0.8, #000)); background: -webkit-linear-gradient(bottom right, #fff 0%, #000 80%); background: -moz-linear-gradient(bottom right, #fff 0%, #000 80%); + background: -o-linear-gradient(bottom right, #fff 0%, #000 80%); + background: -ms-linear-gradient(bottom right, #fff 0%, #000 80%); background: linear-gradient(bottom right, #fff 0%, #000 80%); } body { background: -webkit-gradient(linear, right bottom, left top, color-stop(0, #fff), color-stop(0.8, #000)); background: -webkit-linear-gradient(right bottom, #fff 0%, #000 80%); background: -moz-linear-gradient(right bottom, #fff 0%, #000 80%); + background: -o-linear-gradient(right bottom, #fff 0%, #000 80%); + background: -ms-linear-gradient(right bottom, #fff 0%, #000 80%); background: linear-gradient(right bottom, #fff 0%, #000 80%); } body { diff --git a/test/cases/vendor.border-radius.css b/test/cases/vendor.border-radius.css index 53ea376e..6c183481 100644 --- a/test/cases/vendor.border-radius.css +++ b/test/cases/vendor.border-radius.css @@ -6,11 +6,15 @@ button { button { -moz-border-radius-topleft: 10px; -webkit-border-top-left-radius: 10px; + -o-border-top-left-radius: 10px; + -ms-border-top-left-radius: 10px; border-top-left-radius: 10px; } button { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; + -o-border-bottom-right-radius: 5px; + -ms-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; } button { diff --git a/test/cases/vendor.border-radius.styl b/test/cases/vendor.border-radius.styl index c7a8f8d8..d4f0b256 100644 --- a/test/cases/vendor.border-radius.styl +++ b/test/cases/vendor.border-radius.styl @@ -10,6 +10,8 @@ button button border-radius: bottom right 5px +vendor-prefixes = webkit moz official + button border-radius: top left 5px bottom right 10px diff --git a/test/cases/vendor.css b/test/cases/vendor.css index 615671a3..36f4269e 100644 --- a/test/cases/vendor.css +++ b/test/cases/vendor.css @@ -119,7 +119,7 @@ section { column-gap: 2em; } button { - -o-transition: all 0.1s ease-in-out 1s; + -webkit-transition: all 0.1s ease-in-out 1s; -webkit-transition: all 0.1s ease-in-out 1s; -moz-transition: all 0.1s ease-in-out 1s; transition: all 0.1s ease-in-out 1s; @@ -127,37 +127,30 @@ button { backface-visibility: hidden; } button { - -o-transition-property: all; -webkit-transition-property: all; -moz-transition-property: all; transition-property: all; - -o-transition-duration: 0.1s; -webkit-transition-duration: 0.1s; -moz-transition-duration: 0.1s; transition-duration: 0.1s; - -o-transition-timing-function: ease-in-out; -webkit-transition-timing-function: ease-in-out; -moz-transition-timing-function: ease-in-out; transition-timing-function: ease-in-out; - -o-transition-delay: 1s; -webkit-transition-delay: 1s; -moz-transition-delay: 1s; transition-delay: 1s; } button { - -o-transform: rotateY(45deg); -webkit-transform: rotateY(45deg); -moz-transform: rotateY(45deg); transform: rotateY(45deg); } section { - -o-border-image: url("image.png") 20% stretch stretch; -webkit-border-image: url("image.png") 20% stretch stretch; -moz-border-image: url("image.png") 20% stretch stretch; border-image: url("image.png") 20% stretch stretch; } p { - -o-hyphens: auto; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; diff --git a/test/cases/vendor.styl b/test/cases/vendor.styl index 51c4d7ba..ff8d0847 100644 --- a/test/cases/vendor.styl +++ b/test/cases/vendor.styl @@ -1,6 +1,8 @@ @import 'nib/vendor' +vendor-prefixes = webkit moz official + button box-shadow: 1px 1px 5px #eee diff --git a/test/runner.js b/test/runner.js index 5b4d0fd0..296acc81 100644 --- a/test/runner.js +++ b/test/runner.js @@ -4,153 +4,36 @@ */ var stylus = require('stylus') - , basename = require('path').basename , nib = require('../') , fs = require('fs'); -/** - * Test count. - */ - -var count = 0; - -/** - * Failure count. - */ - -var failures = 0; - -console.log(); - -/** - * Test the given `test`. - * - * @param {String} test - * @param {Function} fn - */ +// test cases -function test(test, fn) { - var base = __dirname + '/cases/' + test - , path = base + '.styl' - , csspath = base + '.css'; +var cases = fs.readdirSync('test/cases').filter(function(file){ + return ~file.indexOf('.styl'); +}).map(function(file){ + return file.replace('.styl', ''); +}); - fs.readFile(path, 'utf8', function(err, str){ - if (err) throw err; +describe('integration', function(){ + cases.forEach(function(test){ + var name = test.replace(/[-.]/g, ' '); + it(name, function(){ + var path = 'test/cases/' + test + '.styl'; + var styl = fs.readFileSync(path, 'utf8').replace(/\r/g, ''); + var css = fs.readFileSync('test/cases/' + test + '.css', 'utf8').replace(/\r/g, '').trim(); - var style = stylus(str) - .use(nib()) - .set('filename', path) - .include(__dirname + '/images') - .include(__dirname + '/cases/import.basic'); + var style = stylus(styl) + .use(nib()) + .set('filename', path) + .define('url', stylus.url()); - if (~test.indexOf('compress')) style.set('compress', true); + if (~test.indexOf('compress')) style.set('compress', true); - style.render(function(err, actual){ - if (err) throw err; - fs.readFile(csspath, 'utf8', function(err, expected){ + style.render(function(err, actual){ if (err) throw err; - expected += '\n'; - if (actual == expected) { - fn(); - } else { - fn(actual, expected); - } + actual.trim().should.equal(css); }); - }); - }); - return test; -}; - -/** - * Auto-load and run tests. - */ - -fs.readdir(__dirname + '/cases', function(err, files){ - if (err) throw err; - var tests = [] - , curr; - - files.forEach(function(file){ - if (/\.styl$/.test(file)) { - ++count; - tests.push(basename(file, '.styl')); - } + }) }); - - (function next() { - curr = tests.shift(); - if (!curr) return done(); - process.stderr.write(' \033[90m' + curr + '\033[0m'); - test(curr, function(actual, expected){ - if (actual) { - ++failures; - console.error('\r \033[31m✖\033[0m \033[90m' + curr + '\033[0m\n'); - diff(actual, expected); - console.error(); - } else { - console.error('\r \033[36m✔\033[0m \033[90m' + curr + '\033[0m'); - } - next(); - }); - })(); -}); - -/** - * Diff `actual` / `expected`. - * - * @param {String} actual - * @param {String} expected - */ - -function diff(actual, expected) { - var actual = actual.split('\n') - , expected = expected.split('\n') - , len = largestLineIn(expected); - - console.error(' expected'); - expected.forEach(function(line, i){ - var other = actual[i] - , pad = len - line.length - , pad = Array(++pad).join(' ') - , same = line == other; - if (same) { - console.error(' %d| %j%s | %j', i+1, line, pad, other); - } else { - console.error(' \033[31m%d| %j%s | %j\033[0m', i+1, line, pad, other); - } - }); -} - -/** - * Return the length of the largest line in `lines`. - * - * @param {Array} lines - * @return {Number} - */ - -function largestLineIn(lines) { - return lines.reduce(function(n, line){ - return Math.max(n, line.length); - }, 0); -} - -/** - * Done!!! - */ - -function done() { - console.log(); - console.log( - ' \033[90mcompleted\033[0m' - + ' \033[32m%d\033[0m' - + ' \033[90mtests\033[0m', count); - - if (failures) { - console.error(' \033[90mfailed\033[0m' - + ' \033[31m%d\033[0m' - + ' \033[90mtests\033[0m', failures); - process.exit(failures); - } - - console.log(); -} \ No newline at end of file +}) \ No newline at end of file From 36d452d7fe8ac4b24dcdf13b435944aca0d35070 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Tue, 3 Apr 2012 16:34:21 -0700 Subject: [PATCH 45/82] Release 0.4.0 --- History.md | 11 +++++++++++ lib/nib.js | 2 +- package.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/History.md b/History.md index 0af08485..5dae81c0 100644 --- a/History.md +++ b/History.md @@ -1,4 +1,15 @@ +0.4.0 / 2012-04-03 +================== + + * Added `box-ordinal-group` support [panosru] + * Added `transform-origin` support [panosru] + * Added `perspective` support + * Added `transform-style` support + * Added `display: box` vendor support + * Removed buttons + * Changed: use mocha for test runner + 0.3.2 / 2012-01-09 ================== diff --git a/lib/nib.js b/lib/nib.js index 182e7f27..3f9f1a34 100644 --- a/lib/nib.js +++ b/lib/nib.js @@ -31,7 +31,7 @@ try { * Library version. */ -exports.version = '0.3.2'; +exports.version = '0.4.0'; /** * Stylus path. diff --git a/package.json b/package.json index 3bb837b4..4736d126 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nib", "description": "Stylus mixins and utilities", - "version": "0.3.2", + "version": "0.4.0", "repository": { "type": "git", "url": "git://github.com/visionmedia/nib.git" From 11bd8bfee634be8589f91c09a4fbdf539fb39d2b Mon Sep 17 00:00:00 2001 From: kizu Date: Sat, 14 Apr 2012 00:29:27 +0400 Subject: [PATCH 46/82] There would be -ms-user-select in IE10 --- lib/nib/vendor.styl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 985e0137..40c77442 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -43,7 +43,7 @@ box-shadow() */ user-select() - vendor('user-select', arguments, only: webkit moz official) + vendor('user-select', arguments, only: webkit moz ms official) /* * Vendor "column-count" support. @@ -86,7 +86,7 @@ column-rule-width() column-rule-style() vendor('column-rule-style', arguments, only: webkit moz official) - + /* * Vendor "background-clip" support. */ From 6e3b6850848d8b483b26716ea28e6aae79e40c2c Mon Sep 17 00:00:00 2001 From: kizu Date: Sat, 14 Apr 2012 00:49:26 +0400 Subject: [PATCH 47/82] Correct prefixes for column-clip, moved it in place with other column- props --- lib/nib/vendor.styl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 40c77442..0f7a8518 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -88,18 +88,18 @@ column-rule-style() vendor('column-rule-style', arguments, only: webkit moz official) /* - * Vendor "background-clip" support. + * Vendor "column-width" support. */ -background-clip() - vendor('background-clip', arguments, only: webkit moz official) +column-width() + vendor('column-width', arguments, only: webkit moz official) /* - * Vendor "column-width" support. + * Vendor "background-clip" support. */ -column-width() - vendor('column-width', arguments) +background-clip() + vendor('background-clip', arguments, only: webkit moz official) /* * Vendor "background-size" support. From 7e217e6c08690da0438604e01e57650d09f79759 Mon Sep 17 00:00:00 2001 From: kizu Date: Sat, 14 Apr 2012 00:52:14 +0400 Subject: [PATCH 48/82] Added column-span and column-fill --- lib/nib/vendor.styl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 0f7a8518..22a0fb2a 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -94,6 +94,20 @@ column-rule-style() column-width() vendor('column-width', arguments, only: webkit moz official) +/* + * Vendor "column-span" support. + */ + +column-span() + vendor('column-span', arguments, only: webkit official) + +/* + * Vendor "column-fill" support. + */ + +column-fill() + vendor('column-fill', arguments, only: moz) + /* * Vendor "background-clip" support. */ From a38045f31d6879a4682a79d18a0dc8f25c731308 Mon Sep 17 00:00:00 2001 From: kizu Date: Sat, 14 Apr 2012 01:44:56 +0400 Subject: [PATCH 49/82] Fixed the background-clip prefixes: it have different syntax for old webkit and moz, also it have only webkit for text --- lib/nib/vendor.styl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 22a0fb2a..847e64e8 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -112,8 +112,15 @@ column-fill() * Vendor "background-clip" support. */ -background-clip() - vendor('background-clip', arguments, only: webkit moz official) +background-clip(box, args...) + if box in (border-box padding-box content-box) + box = border if box == border-box + box = padding if box == padding-box + box = content if box == content-box + vendor('background-clip', box args, only: moz webkit) + if box == text + vendor('background-clip', arguments, only: webkit) + background-clip: arguments /* * Vendor "background-size" support. From 8e75fbe6f030fffcab17971ee13cc8b3d314ba27 Mon Sep 17 00:00:00 2001 From: kizu Date: Sat, 14 Apr 2012 01:58:18 +0400 Subject: [PATCH 50/82] There would be transitions in IE10 --- lib/nib/vendor.styl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 847e64e8..83943c8c 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -161,35 +161,35 @@ border-image() */ transition() - vendor('transition', arguments, only: webkit moz o official) + vendor('transition', arguments) /* * Vendor "transition-property" support. */ transition-property() - vendor('transition-property', arguments, only: webkit moz o official) + vendor('transition-property', arguments) /* * Vendor "transition-duration" support. */ transition-duration() - vendor('transition-duration', arguments, only: webkit moz o official) + vendor('transition-duration', arguments) /* * Vendor "transition-timing-function" support. */ transition-timing-function() - vendor('transition-timing-function', arguments, only: webkit moz o official) + vendor('transition-timing-function', arguments) /* * Vendor "transition-delay" support. */ transition-delay() - vendor('transition-delay', arguments, only: webkit moz o official) + vendor('transition-delay', arguments) /* * Vendor "backface-visibility" support. From 172c962ec2c2d50767c422cedc9bac5720ff31a8 Mon Sep 17 00:00:00 2001 From: kizu Date: Sat, 14 Apr 2012 02:07:29 +0400 Subject: [PATCH 51/82] 3D transforms now in IE10 and in Fx, but still not in Opera --- lib/nib/vendor.styl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 83943c8c..66cf4be2 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -196,14 +196,14 @@ transition-delay() */ backface-visibility() - vendor('backface-visibility', arguments, only: webkit official) + vendor('backface-visibility', arguments, only: webkit moz ms official) /* * Vendor "perspective" support. */ perspective() - vendor('perspective', arguments) + vendor('perspective', arguments, only: webkit moz ms official) /* From bbf44c050d4425b07748716325caa8d5c666a3ce Mon Sep 17 00:00:00 2001 From: kizu Date: Sat, 14 Apr 2012 02:18:59 +0400 Subject: [PATCH 52/82] Updated fexbox prefixes (flex-group is only in webkit, no ordinal-group in Opera) --- lib/nib/vendor.styl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 66cf4be2..824fbdc1 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -248,14 +248,14 @@ box-flex() */ box-flex-group() - vendor('box-flex-group', arguments) + vendor('box-flex-group', arguments, only: webkit official) /* * Vendor "box-ordinal-group" support. */ box-ordinal-group() - vendor('box-ordinal-group', arguments) + vendor('box-ordinal-group', arguments, only: webkit moz ms official) /* From 26bd0565508cb1cbcf9e6056bd4220cfb47a185b Mon Sep 17 00:00:00 2001 From: kizu Date: Sat, 14 Apr 2012 02:20:12 +0400 Subject: [PATCH 53/82] There would be animations in IE10 and probably (there were an experimental build of it) in Opera 12) --- lib/nib/vendor.styl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 824fbdc1..ec16e02a 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -284,7 +284,7 @@ box-direction() */ animation() - vendor('animation', arguments, only: webkit moz official) + vendor('animation', arguments) /* @@ -292,56 +292,56 @@ animation() */ animation-name() - vendor('animation-name', arguments, only: webkit moz official) + vendor('animation-name', arguments) /* * Vendor "animation-duration" support. */ animation-duration() - vendor('animation-duration', arguments, only: webkit moz official) + vendor('animation-duration', arguments) /* * Vendor "animation-delay" support. */ animation-delay() - vendor('animation-delay', arguments, only: webkit moz official) + vendor('animation-delay', arguments) /* * Vendor "animation-direction" support. */ animation-direction() - vendor('animation-direction', arguments, only: webkit moz official) + vendor('animation-direction', arguments) /* * Vendor "animation-iteration-count" support. */ animation-iteration-count() - vendor('animation-iteration-count', arguments, only: webkit moz official) + vendor('animation-iteration-count', arguments) /* * Vendor "animation-timing-function" support. */ animation-timing-function() - vendor('animation-timing-function', arguments, only: webkit moz official) + vendor('animation-timing-function', arguments) /* * Vendor "animation-play-state" support. */ animation-play-state() - vendor('animation-play-state', arguments, only: webkit moz official) + vendor('animation-play-state', arguments) /* * Vendor "animation-fill-mode" support. */ animation-fill-mode() - vendor('animation-fill-mode', arguments, only: webkit moz official) + vendor('animation-fill-mode', arguments) /* * Vendor "border-image" support. From 4729c2786f11bd9430b10390d604fb14031f77f7 Mon Sep 17 00:00:00 2001 From: kizu Date: Sat, 14 Apr 2012 02:28:08 +0400 Subject: [PATCH 54/82] Still no hyphens in Opera --- lib/nib/vendor.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index ec16e02a..7d9564b1 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -355,7 +355,7 @@ border-image() */ hyphens() - vendor('hyphens', arguments) + vendor('hyphens', arguments, only: webkit moz ms official) /* From 81082b68ecf64470474be2883eaad75214a99971 Mon Sep 17 00:00:00 2001 From: kizu Date: Sat, 14 Apr 2012 02:29:42 +0400 Subject: [PATCH 55/82] Appearance is only webkit/moz now --- lib/nib/vendor.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 7d9564b1..294d1d1d 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -363,7 +363,7 @@ hyphens() */ appearance() - vendor('appearance', arguments) + vendor('appearance', arguments, only: webkit moz) /* * Helper for border-radius(). From b7a86876f1406c3e70bdaef8296a7f7b46120994 Mon Sep 17 00:00:00 2001 From: kizu Date: Sat, 14 Apr 2012 02:34:58 +0400 Subject: [PATCH 56/82] There were no importance for overflow --- lib/nib/overflow.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nib/overflow.styl b/lib/nib/overflow.styl index 55726a00..277a400c 100644 --- a/lib/nib/overflow.styl +++ b/lib/nib/overflow.styl @@ -20,4 +20,4 @@ overflow() if arguments[0] == ellipsis ellipsis() else - overflow: arguments[0] + overflow: arguments From 829cfa66ae19195763fd6f0140a585573c7b63ae Mon Sep 17 00:00:00 2001 From: kizu Date: Sat, 14 Apr 2012 02:43:06 +0400 Subject: [PATCH 57/82] There is a moz-box-flex-group actually --- lib/nib/vendor.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 294d1d1d..f615f5e0 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -248,7 +248,7 @@ box-flex() */ box-flex-group() - vendor('box-flex-group', arguments, only: webkit official) + vendor('box-flex-group', arguments, only: webkit moz official) /* * Vendor "box-ordinal-group" support. From bc40972e1ab1daea77b996c9191a5d1d498951a6 Mon Sep 17 00:00:00 2001 From: kizu Date: Sat, 14 Apr 2012 02:46:56 +0400 Subject: [PATCH 58/82] Updated old tests --- test/cases/vendor.css | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/cases/vendor.css b/test/cases/vendor.css index 36f4269e..74c18676 100644 --- a/test/cases/vendor.css +++ b/test/cases/vendor.css @@ -71,7 +71,6 @@ button { button { -webkit-appearance: none; -moz-appearance: none; - appearance: none; } section { -webkit-column-count: 2; @@ -119,33 +118,40 @@ section { column-gap: 2em; } button { - -webkit-transition: all 0.1s ease-in-out 1s; + -o-transition: all 0.1s ease-in-out 1s; -webkit-transition: all 0.1s ease-in-out 1s; -moz-transition: all 0.1s ease-in-out 1s; transition: all 0.1s ease-in-out 1s; -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; backface-visibility: hidden; } button { + -o-transition-property: all; -webkit-transition-property: all; -moz-transition-property: all; transition-property: all; + -o-transition-duration: 0.1s; -webkit-transition-duration: 0.1s; -moz-transition-duration: 0.1s; transition-duration: 0.1s; + -o-transition-timing-function: ease-in-out; -webkit-transition-timing-function: ease-in-out; -moz-transition-timing-function: ease-in-out; transition-timing-function: ease-in-out; + -o-transition-delay: 1s; -webkit-transition-delay: 1s; -moz-transition-delay: 1s; transition-delay: 1s; } button { + -o-transform: rotateY(45deg); -webkit-transform: rotateY(45deg); -moz-transform: rotateY(45deg); transform: rotateY(45deg); } section { + -o-border-image: url("image.png") 20% stretch stretch; -webkit-border-image: url("image.png") 20% stretch stretch; -moz-border-image: url("image.png") 20% stretch stretch; border-image: url("image.png") 20% stretch stretch; @@ -154,4 +160,4 @@ p { -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; -} \ No newline at end of file +} From 9e7c3594c052d1fbe5e821af691a49112a15dc2a Mon Sep 17 00:00:00 2001 From: kizu Date: Sat, 14 Apr 2012 18:28:11 +0400 Subject: [PATCH 59/82] Preserving importance for opacity --- lib/nib/vendor.styl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index f615f5e0..12e9d185 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -210,10 +210,10 @@ perspective() * Opacity with conditional IE support. */ -opacity(n) - opacity: n +opacity(n, args...) + opacity: n args if support-for-ie - filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=%s)' % round(n * 100) + filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=%s)' % round(n * 100) args /* * Alias the "white-space" property. From 10c8ef8d7912b62c1354f311e5ff9b0e2f99d776 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Sun, 15 Apr 2012 10:31:11 -0700 Subject: [PATCH 60/82] Release 0.4.1 --- History.md | 16 ++++++++++++++++ lib/nib.js | 2 +- package.json | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/History.md b/History.md index 5dae81c0..74f8e26f 100644 --- a/History.md +++ b/History.md @@ -1,4 +1,20 @@ +0.4.1 / 2012-04-15 +================== + + * There is a moz-box-flex-group actually [kizu] + * There were no importance for overflow [kizu] + * Appearance is only webkit/moz now [kizu] + * Still no hyphens in Opera [kizu] + * There would be animations in IE10 and probably (there were an experimental build of it) in Opera 12) [kizu] + * Updated fexbox prefixes (flex-group is only in webkit, no ordinal-group in Opera) [kizu] + * 3D transforms now in IE10 and in Fx, but still not in Opera [kizu] + * There would be transitions in IE10 [kizu] + * Fixed the background-clip prefixes: it have different syntax for old webkit and moz, also it have only webkit for text [kizu] + * Added column-span and column-fill [kizu] + * Correct prefixes for column-clip, moved it in place with other column- props [kizu] + * There would be -ms-user-select in IE10 [kizu] + 0.4.0 / 2012-04-03 ================== diff --git a/lib/nib.js b/lib/nib.js index 3f9f1a34..dadf4043 100644 --- a/lib/nib.js +++ b/lib/nib.js @@ -31,7 +31,7 @@ try { * Library version. */ -exports.version = '0.4.0'; +exports.version = '0.4.1'; /** * Stylus path. diff --git a/package.json b/package.json index 4736d126..58371298 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nib", "description": "Stylus mixins and utilities", - "version": "0.4.0", + "version": "0.4.1", "repository": { "type": "git", "url": "git://github.com/visionmedia/nib.git" From d23e35e298ec8bbdc6f4ce3f635c4ed2cf81a354 Mon Sep 17 00:00:00 2001 From: Roman Komarov Date: Mon, 16 Apr 2012 17:21:37 +0400 Subject: [PATCH 61/82] Refactored background-clip, added background-origin. --- lib/nib/vendor.styl | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 12e9d185..cbb97106 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -108,19 +108,43 @@ column-span() column-fill() vendor('column-fill', arguments, only: moz) +/* + * Legacy syntax support for background-clip and background-origin + */ + +legacy-bg-values(property, args) + legacy_args = () + importance = unquote('') + for subargs in args + for arg in subargs + if arg in (border-box padding-box content-box) + arg = border if arg == border-box + arg = padding if arg == padding-box + arg = content if arg == content-box + if arg != '!important' + push(legacy_args,arg) + else + importance = !important + vendor(property, unquote(join(', ',legacy_args)) importance, only: moz webkit) + /* * Vendor "background-clip" support. */ -background-clip(box, args...) - if box in (border-box padding-box content-box) - box = border if box == border-box - box = padding if box == padding-box - box = content if box == content-box - vendor('background-clip', box args, only: moz webkit) - if box == text +background-clip() + if arguments[0] == text vendor('background-clip', arguments, only: webkit) - background-clip: arguments + else + legacy-bg-values('background-clip', arguments) + background-clip: arguments + +/* + * Vendor "background-origin" support. + */ + +background-origin() + legacy-bg-values('background-origin', arguments) + background-origin: arguments /* * Vendor "background-size" support. From b99eec085942ae050e275f9a1a981329a305394c Mon Sep 17 00:00:00 2001 From: Irving Kcam Date: Mon, 16 Apr 2012 20:15:22 -0500 Subject: [PATCH 62/82] Line 73 - 76: Corrects inline-block display not defined in IE6/7/8/9 & FF3 Line 77 - 78: Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4 According to Normalize.css(https://github.com/necolas/normalize.css) --- lib/nib/reset.styl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/nib/reset.styl b/lib/nib/reset.styl index 85c4e0ac..ede92773 100644 --- a/lib/nib/reset.styl +++ b/lib/nib/reset.styl @@ -70,3 +70,10 @@ reset-html5() section, summary reset-box-model() display: block + audio, canvas, video + display inline-block + *display inline + *zoom 1 + audio:not([controls]),[hidden] + display none + From 6e8773b45da84508c23bd507cf686cf7c4638672 Mon Sep 17 00:00:00 2001 From: Ben Gourley Date: Tue, 17 Apr 2012 18:30:33 +0100 Subject: [PATCH 63/82] Remove duplicate imports and defines (fixes #81) --- lib/nib/overflow.styl | 3 --- lib/nib/vendor.styl | 7 ------- 2 files changed, 10 deletions(-) diff --git a/lib/nib/overflow.styl b/lib/nib/overflow.styl index 277a400c..c89a8221 100644 --- a/lib/nib/overflow.styl +++ b/lib/nib/overflow.styl @@ -1,6 +1,3 @@ - -@import 'text/ellipsis' - /* * Overflow utility. Maps to regular overflow, and adds an ellipsis value. * diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index cbb97106..1a375ff4 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -367,13 +367,6 @@ animation-play-state() animation-fill-mode() vendor('animation-fill-mode', arguments) -/* - * Vendor "border-image" support. - */ - -border-image() - vendor('border-image', arguments, only: webkit moz o official) - /* * Vendor "hyphens" support. */ From 6b10dceab6bffc6b38324bcaa361063193ae53cf Mon Sep 17 00:00:00 2001 From: kizu Date: Wed, 18 Apr 2012 01:44:50 +0400 Subject: [PATCH 64/82] Added tab-size property --- lib/nib/vendor.styl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index cbb97106..c80205e9 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -381,7 +381,6 @@ border-image() hyphens() vendor('hyphens', arguments, only: webkit moz ms official) - /* * Vendor "appearance" support. */ @@ -389,6 +388,13 @@ hyphens() appearance() vendor('appearance', arguments, only: webkit moz) +/* + * Vendor "tab-size" support. + */ + +tab-size() + vendor('tab-size', arguments, only: moz o) + /* * Helper for border-radius(). */ From c8cca4e765a4d1f94a0e849ca6095cf074d0b62f Mon Sep 17 00:00:00 2001 From: kizu Date: Wed, 18 Apr 2012 01:57:25 +0400 Subject: [PATCH 65/82] Added perspective-origin property --- lib/nib/vendor.styl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index c80205e9..78960807 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -229,6 +229,13 @@ backface-visibility() perspective() vendor('perspective', arguments, only: webkit moz ms official) +/* + * Vendor "perspective-origin" support. + */ + +perspective-origin() + vendor('perspective-origin', arguments, only: webkit moz ms official) + /* * Opacity with conditional IE support. From d7e6c329d1994027ed44190929ce62f12b80116e Mon Sep 17 00:00:00 2001 From: Tyler Nieman Date: Fri, 20 Apr 2012 08:35:56 -0700 Subject: [PATCH 66/82] documentation fix on synopsis for relative() position utility (copy/paste error) --- lib/nib/positions.styl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/nib/positions.styl b/lib/nib/positions.styl index d8b2cdfb..654d4440 100644 --- a/lib/nib/positions.styl +++ b/lib/nib/positions.styl @@ -1,4 +1,3 @@ - // helper -pos(type, args) @@ -50,7 +49,7 @@ absolute() * * Synopsis: * - * absolute: [n] [n] + * relative: [n] [n] * * Examples: * From 62b9347ee99623dcccfb691501aafeefaaedd9d7 Mon Sep 17 00:00:00 2001 From: Tom Stoecklein Date: Fri, 27 Apr 2012 09:11:39 -0400 Subject: [PATCH 67/82] Deprecated a couple EOL moz prefixes, removed -o-background-size -FF 3.6 at ~2.6% market share trending downward, so -moz- prefix can be removed for border-radius & background-size as no longer necessary. - Removed -o- prefix from background-size as Opera never supported it Should take care of it all. More info: * https://github.com/paulirish/css3please/commit/52eaa342330c089b278e669abaedb34cc5889bf1 * http://www.opera.com/docs/specs/presto28/css/o-vendor/ --- lib/nib/vendor.styl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 85c3e184..2626711b 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -36,7 +36,7 @@ vendor-value(arg) */ box-shadow() - vendor('box-shadow', arguments, only: webkit moz official) + vendor('box-shadow', arguments, only: webkit official) /* * Vendor "user-select" support. @@ -151,7 +151,7 @@ background-origin() */ background-size() - vendor('background-size', arguments, only: webkit moz o official) + vendor('background-size', arguments, only: webkit official) /* * Vendor "transform" support. @@ -445,4 +445,4 @@ border-radius() if augmented -apply-border-radius(pos) pos = () - vendor('border-radius', pos, only: webkit moz official) unless augmented + vendor('border-radius', pos, only: webkit official) unless augmented \ No newline at end of file From d07992036a0020894daae0f931b666e7bba12772 Mon Sep 17 00:00:00 2001 From: Dustan Kasten Date: Mon, 7 May 2012 13:04:52 -0300 Subject: [PATCH 68/82] Update opacity to clear issue with IE rendering value of 100 (to override previous semi-opaque state) and support IE5-8 in all the different varieties of life (http://www.quirksmode.org/css/opacity.html) --- lib/nib/vendor.styl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index 2626711b..cc84a22c 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -244,7 +244,13 @@ perspective-origin() opacity(n, args...) opacity: n args if support-for-ie - filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=%s)' % round(n * 100) args + ieValue = round(n * 100) + if ieValue==100 + -ms-filter: none + filter: none + else + -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=%s)' % ieValue args + filter: 'alpha(opacity=%s)' % ieValue args /* * Alias the "white-space" property. From 2b43ba13989a75c058bc9754f782756e0dbd78dd Mon Sep 17 00:00:00 2001 From: Dustan Kasten Date: Mon, 7 May 2012 13:57:04 -0300 Subject: [PATCH 69/82] Whitespace? Never heard of it ;) --- lib/nib/vendor.styl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index cc84a22c..f84e147b 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -244,8 +244,8 @@ perspective-origin() opacity(n, args...) opacity: n args if support-for-ie - ieValue = round(n * 100) - if ieValue==100 + val = round(n * 100) + if val == 100 -ms-filter: none filter: none else From a6c4717aa8f4a1af43534c7f00e749e299c127d4 Mon Sep 17 00:00:00 2001 From: Dustan Kasten Date: Mon, 7 May 2012 13:57:42 -0300 Subject: [PATCH 70/82] Editing in github means I forget things. --- lib/nib/vendor.styl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index f84e147b..e677d243 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -249,8 +249,8 @@ opacity(n, args...) -ms-filter: none filter: none else - -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=%s)' % ieValue args - filter: 'alpha(opacity=%s)' % ieValue args + -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=%s)' % val args + filter: 'alpha(opacity=%s)' % val args /* * Alias the "white-space" property. From 8bb1e9e4de0b7b775ccf01ba30b8a9ce3fa0e48e Mon Sep 17 00:00:00 2001 From: Roman Komarov Date: Fri, 25 May 2012 01:47:03 +0400 Subject: [PATCH 71/82] Updated stylus dependency, fixes #89 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 58371298..eaab8322 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "devDependencies": { "connect": "1.x" , "jade": "0.22.0" - , "stylus": "0.19.x" + , "stylus": "0.27.x" , "mocha": "*" , "should": "*" , "canvas": "*" From a189ce7903e1b626bd66adced5ae39733c753e13 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Mon, 28 May 2012 12:06:32 -0700 Subject: [PATCH 72/82] Release 0.5.0 --- History.md | 12 ++++++++++++ lib/nib.js | 2 +- package.json | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/History.md b/History.md index 74f8e26f..0bda726e 100644 --- a/History.md +++ b/History.md @@ -1,4 +1,16 @@ +0.5.0 / 2012-05-28 +================== + + * Added perspective-origin property + * Added tab-size property + * Updated stylus dependency, fixes #89 + * Update opacity to clear issue with IE rendering value of 100 (to override previous semi-opaque state) and support IE5-8 in all the different varieties of life (http://www.quirksmode.org/css/opacity.html) + * Deprecated a couple EOL moz prefixes, removed -o-background-size + * Remove duplicate imports and defines (fixes #81) + * Refactored background-clip, added background-origin. + * Preserving importance for opacity + 0.4.1 / 2012-04-15 ================== diff --git a/lib/nib.js b/lib/nib.js index dadf4043..a4527a3a 100644 --- a/lib/nib.js +++ b/lib/nib.js @@ -31,7 +31,7 @@ try { * Library version. */ -exports.version = '0.4.1'; +exports.version = '0.5.0'; /** * Stylus path. diff --git a/package.json b/package.json index eaab8322..49f96766 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nib", "description": "Stylus mixins and utilities", - "version": "0.4.1", + "version": "0.5.0", "repository": { "type": "git", "url": "git://github.com/visionmedia/nib.git" From a9aed23b619bcf453c66541f6780f5c51181cc09 Mon Sep 17 00:00:00 2001 From: kizu Date: Tue, 29 May 2012 00:38:42 +0400 Subject: [PATCH 73/82] Updated tests according to the latest code changes --- test/cases/vendor.border-radius.css | 4 +--- test/cases/vendor.css | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/test/cases/vendor.border-radius.css b/test/cases/vendor.border-radius.css index 6c183481..a9d190c1 100644 --- a/test/cases/vendor.border-radius.css +++ b/test/cases/vendor.border-radius.css @@ -1,6 +1,5 @@ button { -webkit-border-radius: 1px 2px/3px 4px; - -moz-border-radius: 1px 2px/3px 4px; border-radius: 1px 2px/3px 4px; } button { @@ -57,6 +56,5 @@ button { } button { -webkit-border-radius: 5px; - -moz-border-radius: 5px; border-radius: 5px; -} \ No newline at end of file +} diff --git a/test/cases/vendor.css b/test/cases/vendor.css index 74c18676..ffe17217 100644 --- a/test/cases/vendor.css +++ b/test/cases/vendor.css @@ -1,11 +1,11 @@ button { -webkit-box-shadow: 1px 1px 5px #eee; - -moz-box-shadow: 1px 1px 5px #eee; box-shadow: 1px 1px 5px #eee; } button { opacity: 0.5; - filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); + -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=50); + filter: alpha(opacity=50); } button { opacity: 0.75; From ac1a1cb87acc6bb38b6bf4573c55980abca7ba1e Mon Sep 17 00:00:00 2001 From: Tom Stoecklein Date: Wed, 13 Jun 2012 21:05:02 -0400 Subject: [PATCH 74/82] + hide() mixin for text-indent: 100% method - measurable performance gains over 99999em method - added as hide() mixin instead of changing hide-text() for backwards compatability; in almost every case it's a drop-in replacement but best not to screw with what people expect from their mixins --- lib/nib/text/hide-text.styl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/nib/text/hide-text.styl b/lib/nib/text/hide-text.styl index b3c8c77f..ed2c46e6 100644 --- a/lib/nib/text/hide-text.styl +++ b/lib/nib/text/hide-text.styl @@ -2,6 +2,11 @@ * Hide text. */ +hide() + text-indent: 100% + white-space: nowrap + overflow: hidden + hide-text() text-indent: -99999em overflow: hidden From b1ab1a20c2ed2dffd6de6c72dbe2f8de6d34f8d5 Mon Sep 17 00:00:00 2001 From: Tom Stoecklein Date: Wed, 13 Jun 2012 21:44:08 -0400 Subject: [PATCH 75/82] replace hide-text() w/ text-indent: 100% method --- lib/nib/text/hide-text.styl | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/nib/text/hide-text.styl b/lib/nib/text/hide-text.styl index ed2c46e6..1571b79c 100644 --- a/lib/nib/text/hide-text.styl +++ b/lib/nib/text/hide-text.styl @@ -2,12 +2,7 @@ * Hide text. */ -hide() +hide-text() text-indent: 100% white-space: nowrap - overflow: hidden - -hide-text() - text-indent: -99999em - overflow: hidden - text-align: left \ No newline at end of file + overflow: hidden \ No newline at end of file From f77233614e8628c2972e6977a3c7010ae0f2a25e Mon Sep 17 00:00:00 2001 From: Ian Young Date: Tue, 19 Jun 2012 12:17:21 -0700 Subject: [PATCH 76/82] Text replacement mixin --- lib/nib/text/replace-text.styl | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 lib/nib/text/replace-text.styl diff --git a/lib/nib/text/replace-text.styl b/lib/nib/text/replace-text.styl new file mode 100644 index 00000000..3aabff1b --- /dev/null +++ b/lib/nib/text/replace-text.styl @@ -0,0 +1,9 @@ +/* + * Replace text with an image. + */ + +replace-text(image, x=50%, y=50%) + hide-text() + background-image image + background-repeat no-repeat + background-position x y From 27e321bda52d491f1de3de43f485b8fafcb1124b Mon Sep 17 00:00:00 2001 From: PG Herveou Date: Tue, 26 Jun 2012 19:40:32 +0300 Subject: [PATCH 77/82] Update master --- lib/nib/vendor.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index e677d243..0c7b4ffb 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -151,7 +151,7 @@ background-origin() */ background-size() - vendor('background-size', arguments, only: webkit official) + vendor('background-size', arguments, only: webkit moz official) /* * Vendor "transform" support. From afbbe544353ad94a703b166e3fc850e68aedd5fc Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Thu, 28 Jun 2012 14:26:48 -0700 Subject: [PATCH 78/82] add "border: color" -> "border: 1px solid color" support --- lib/nib/border.styl | 11 +++++++++++ lib/nib/index.styl | 1 + test/cases/border.css | 4 ++++ test/cases/border.styl | 6 ++++++ 4 files changed, 22 insertions(+) create mode 100644 lib/nib/border.styl create mode 100644 test/cases/border.css create mode 100644 test/cases/border.styl diff --git a/lib/nib/border.styl b/lib/nib/border.styl new file mode 100644 index 00000000..5f39f7d3 --- /dev/null +++ b/lib/nib/border.styl @@ -0,0 +1,11 @@ + +/* + * border: + * border: ... + */ + +border() + if 1 == length(arguments) + border: 1px solid arguments + else + border: arguments diff --git a/lib/nib/index.styl b/lib/nib/index.styl index 7ddf70ab..61a1ed6b 100644 --- a/lib/nib/index.styl +++ b/lib/nib/index.styl @@ -8,3 +8,4 @@ @import 'gradients' @import 'box' @import 'color-image' +@import 'border' diff --git a/test/cases/border.css b/test/cases/border.css new file mode 100644 index 00000000..aae2e4fb --- /dev/null +++ b/test/cases/border.css @@ -0,0 +1,4 @@ +.foo { + border: 1px solid #f00; + border: 1px solid #f00; +} \ No newline at end of file diff --git a/test/cases/border.styl b/test/cases/border.styl new file mode 100644 index 00000000..ccbb91e4 --- /dev/null +++ b/test/cases/border.styl @@ -0,0 +1,6 @@ + +@import 'nib/border' + +.foo + border: red + border: 1px solid red \ No newline at end of file From 230971936b199d4e1ef70d12d7b23d8ca63e35e8 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Fri, 29 Jun 2012 09:57:55 -0700 Subject: [PATCH 79/82] fix "border: none" case --- lib/nib/border.styl | 6 +++--- test/cases/border.css | 1 + test/cases/border.styl | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/nib/border.styl b/lib/nib/border.styl index 5f39f7d3..16ca210a 100644 --- a/lib/nib/border.styl +++ b/lib/nib/border.styl @@ -4,8 +4,8 @@ * border: ... */ -border() - if 1 == length(arguments) - border: 1px solid arguments +border(color) + if color is a 'color' + border: 1px solid color else border: arguments diff --git a/test/cases/border.css b/test/cases/border.css index aae2e4fb..3d3c0563 100644 --- a/test/cases/border.css +++ b/test/cases/border.css @@ -1,4 +1,5 @@ .foo { + border: none; border: 1px solid #f00; border: 1px solid #f00; } \ No newline at end of file diff --git a/test/cases/border.styl b/test/cases/border.styl index ccbb91e4..92e5e7b0 100644 --- a/test/cases/border.styl +++ b/test/cases/border.styl @@ -2,5 +2,6 @@ @import 'nib/border' .foo + border: none border: red border: 1px solid red \ No newline at end of file From 7701921a566432a98930ad20a1419715e61d449d Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Thu, 5 Jul 2012 15:22:20 -0700 Subject: [PATCH 80/82] add support for linear-gradient(stops...). Closes #110 --- lib/nib/gradients.styl | 5 +++++ test/cases/linear-gradient.css | 8 ++++++++ test/cases/linear-gradient.styl | 3 +++ 3 files changed, 16 insertions(+) diff --git a/lib/nib/gradients.styl b/lib/nib/gradients.styl index db3bf207..04936c10 100644 --- a/lib/nib/gradients.styl +++ b/lib/nib/gradients.styl @@ -107,6 +107,11 @@ linear-gradient(start, stops...) error('color stops required') unless length(stops) prop = current-property[0] val = current-property[1] + + if start is a 'color' + unshift(stops, start) + start = top + stops = normalize-stops(stops) // gradient image diff --git a/test/cases/linear-gradient.css b/test/cases/linear-gradient.css index 7ec8c820..d37939f8 100644 --- a/test/cases/linear-gradient.css +++ b/test/cases/linear-gradient.css @@ -6,6 +6,14 @@ body { background: -ms-linear-gradient(top, #fff 0%, #000 100%); background: linear-gradient(top, #fff 0%, #000 100%); } +body { + background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(1, #000)); + background: -webkit-linear-gradient(top, #fff 0%, #000 100%); + background: -moz-linear-gradient(top, #fff 0%, #000 100%); + background: -o-linear-gradient(top, #fff 0%, #000 100%); + background: -ms-linear-gradient(top, #fff 0%, #000 100%); + background: linear-gradient(top, #fff 0%, #000 100%); +} body { background: -webkit-gradient(linear, left top, right bottom, color-stop(0, #fff), color-stop(0.25, #f00), color-stop(0.5, #00f), color-stop(1, #000)); background: -webkit-linear-gradient(top left, #fff 0%, #f00 25%, #00f 50%, #000 100%); diff --git a/test/cases/linear-gradient.styl b/test/cases/linear-gradient.styl index 7d9fcc35..692674b3 100644 --- a/test/cases/linear-gradient.styl +++ b/test/cases/linear-gradient.styl @@ -1,6 +1,9 @@ @import 'nib/gradients' +body + background: linear-gradient(white, black) + body background: linear-gradient(top, white, black) From b4c5dacad3b3fbcf43d27ad61dd7402a1bbbdd23 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Thu, 5 Jul 2012 15:23:40 -0700 Subject: [PATCH 81/82] Release 0.6.0 --- History.md | 6 ++++++ lib/nib.js | 2 +- package.json | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/History.md b/History.md index 0bda726e..4a9aa6f8 100644 --- a/History.md +++ b/History.md @@ -1,4 +1,10 @@ +0.6.0 / 2012-07-05 +================== + + * add support for `linear-gradient(stops...)`. Closes #110 + * replace hide-text() w/ text-indent: 100% method + 0.5.0 / 2012-05-28 ================== diff --git a/lib/nib.js b/lib/nib.js index a4527a3a..25322df5 100644 --- a/lib/nib.js +++ b/lib/nib.js @@ -31,7 +31,7 @@ try { * Library version. */ -exports.version = '0.5.0'; +exports.version = '0.6.0'; /** * Stylus path. diff --git a/package.json b/package.json index 49f96766..6c62eda7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nib", "description": "Stylus mixins and utilities", - "version": "0.5.0", + "version": "0.6.0", "repository": { "type": "git", "url": "git://github.com/visionmedia/nib.git" From cb6523c833649ec3735fd93b184922adb5ea8e15 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Sat, 7 Jul 2012 08:43:26 -0700 Subject: [PATCH 82/82] add image(path, [w], [h]) mixing --- lib/nib/image.styl | 14 ++++++++++++++ lib/nib/index.styl | 2 ++ package.json | 2 +- test/cases/image.css | 18 ++++++++++++++++++ test/cases/image.styl | 8 ++++++++ 5 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 lib/nib/image.styl create mode 100644 test/cases/image.css create mode 100644 test/cases/image.styl diff --git a/lib/nib/image.styl b/lib/nib/image.styl new file mode 100644 index 00000000..7aeda332 --- /dev/null +++ b/lib/nib/image.styl @@ -0,0 +1,14 @@ + +/* + * Define background-image as `path` + * with optional width and height, + * adding an @2x variant. + */ + +image(path, w = auto, h = auto) + background-image: url(path) + @media all and (-webkit-min-device-pixel-ratio: 1.5) + ext = extname(path) + path = pathjoin(dirname(path), basename(path, ext) + '@2x' + ext) + background-image: url(path) + background-size: w h diff --git a/lib/nib/index.styl b/lib/nib/index.styl index 61a1ed6b..2348c2fb 100644 --- a/lib/nib/index.styl +++ b/lib/nib/index.styl @@ -1,3 +1,4 @@ + @import 'vendor' @import 'text' @import 'reset' @@ -9,3 +10,4 @@ @import 'box' @import 'color-image' @import 'border' +@import 'image' diff --git a/package.json b/package.json index 6c62eda7..715e477f 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "devDependencies": { "connect": "1.x" , "jade": "0.22.0" - , "stylus": "0.27.x" + , "stylus": "0.28.x" , "mocha": "*" , "should": "*" , "canvas": "*" diff --git a/test/cases/image.css b/test/cases/image.css new file mode 100644 index 00000000..9cfd0579 --- /dev/null +++ b/test/cases/image.css @@ -0,0 +1,18 @@ +#logo { + background-image: url("/images/branding/logo.main.png"); +} +@media all and (-webkit-min-device-pixel-ratio: 1.5) { + #logo { + background-image: url("/images/branding/logo.main@2x.png"); + background-size: auto auto; + } +} +#logo { + background-image: url("/images/branding/logo.main.png"); +} +@media all and (-webkit-min-device-pixel-ratio: 1.5) { + #logo { + background-image: url("/images/branding/logo.main@2x.png"); + background-size: 50px 100px; + } +} \ No newline at end of file diff --git a/test/cases/image.styl b/test/cases/image.styl new file mode 100644 index 00000000..0fb6dff8 --- /dev/null +++ b/test/cases/image.styl @@ -0,0 +1,8 @@ + +@import 'nib/image' + +#logo + image: '/images/branding/logo.main.png' + +#logo + image: '/images/branding/logo.main.png' 50px 100px