From c5bfee18ddf208bac2de3b0f7c994dae6de29e12 Mon Sep 17 00:00:00 2001 From: kizu Date: Thu, 17 May 2012 23:07:33 +0400 Subject: [PATCH 1/7] Removed legacy webkit support; commented out the canvas generated linear gradient; prepared the linear gradient to be available in vendor-prefixed properties like border-image; actually fixes #14; fixes #71 --- lib/nib/gradients.styl | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/lib/nib/gradients.styl b/lib/nib/gradients.styl index 3bbff794..36813c34 100644 --- a/lib/nib/gradients.styl +++ b/lib/nib/gradients.styl @@ -15,19 +15,6 @@ replace(expr, str, val) expr[i] = val expr -/* - * Normalize gradient points. - */ - -grad-point(pos) - if length(pos) == 1 - return left pos if pos in (top bottom) - return pos top if pos in (left right) - else if pos[0] in (top bottom) - pos[1] pos[0] - else - pos - /* * Implicit color stop position. */ @@ -76,13 +63,6 @@ join-stops(stops, translate) str += translate(color, pos) unquote(str) -/* - * Legacy Webkit color stop. - */ - -webkit-stop(color, pos) - 'color-stop(%d, %s)' % (pos / 100 color) - /* * Standard color stop. */ From d422aa701c835cbe0e6ccf7c6299eedf4efa67a9 Mon Sep 17 00:00:00 2001 From: kizu Date: Fri, 18 May 2012 00:17:50 +0400 Subject: [PATCH 2/7] Applying linear-gradient to border-image; fixes #19 --- lib/nib/vendor.styl | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index f76d73b6..a1f9cfbd 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -45,24 +45,27 @@ literal-join(string, literals) return result /* - * Replacing one value with another + * Prepend matched argument with given prefix + * set strict to false to check as “begin with” */ -replace-args(args,argument,val) +prepend-args(args, prefix, argument, strict = true) result = () // Checking if there are values divided by comma if is-comma-list(args) for subargs in args subresult = () for arg in subargs - arg = unquote(val) if arg == argument + if (arg == argument and strict) or (match('^'+s('%s',argument),''+arg) and !strict) + arg = s('%s%s',unquote(prefix),arg) push(subresult, arg) subresult = literal-join(' ', subresult) if length(subresult) > 1 push(result, subresult) result = literal-join(', ', result) else for arg in args - arg = unquote(val) if arg == argument + if (arg == argument and strict) or (match('^'+s('%s',argument),''+arg) and !strict) + arg = s('%s%s',unquote(prefix),arg) push(result, arg) return result @@ -81,7 +84,9 @@ vendor(prop, args, only = null, ignore = null) newargs = args // Adjusting the args if needed if prop in ('transition' 'transition-property') - newargs = replace-args(args, transform, '-' + prefix + '-transform') + newargs = prepend-args(args, '-' + prefix + '-', transform) + if prop in ('border-image') + newargs = prepend-args(args, '-' + prefix + '-', linear-gradient, false) {'-' + prefix + '-' + prop}: newargs /* @@ -578,4 +583,4 @@ placeholder() pair() else if pair is not null && pair[0] is not null {pair[0]}: type(pair[1]) == 'string' ? s(pair[1]) : pair[1] -input-placeholder = placeholder \ No newline at end of file +input-placeholder = placeholder From 82310f6417004a427753af9578008a451c8753e7 Mon Sep 17 00:00:00 2001 From: kizu Date: Fri, 25 May 2012 01:45:17 +0400 Subject: [PATCH 3/7] Removed the legacy webkit gradients from tests --- test/cases/linear-gradient.css | 6 ------ 1 file changed, 6 deletions(-) diff --git a/test/cases/linear-gradient.css b/test/cases/linear-gradient.css index 2a98cab9..078c94d9 100644 --- a/test/cases/linear-gradient.css +++ b/test/cases/linear-gradient.css @@ -1,5 +1,4 @@ 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%); @@ -15,7 +14,6 @@ body { 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%); @@ -23,7 +21,6 @@ body { 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%); @@ -31,7 +28,6 @@ body { 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%); @@ -39,7 +35,6 @@ body { background: linear-gradient(right bottom, #fff 0, #000 80%); } 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: -ms-linear-gradient(top, #fff 0, #000 100%); @@ -47,7 +42,6 @@ body { 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; From 8f8231ae15c8cff60dd2b9c88aa14b688b853a8b Mon Sep 17 00:00:00 2001 From: kizu Date: Fri, 25 May 2012 17:30:34 +0400 Subject: [PATCH 4/7] Moved whole logic from the gradient function to the vendor ones, rewriting the background, background-image etc. Fixes #67 --- lib/nib/gradients.styl | 35 +++++++------------------- lib/nib/vendor.styl | 44 ++++++++++++++++++++++++++++++--- test/cases/linear-gradient.styl | 3 ++- 3 files changed, 52 insertions(+), 30 deletions(-) diff --git a/lib/nib/gradients.styl b/lib/nib/gradients.styl index 36813c34..db3a7bdf 100644 --- a/lib/nib/gradients.styl +++ b/lib/nib/gradients.styl @@ -85,35 +85,18 @@ std-stop(color, pos) 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 + // if current-property + // if start is a 'color' + // unshift(stops, start) + // start = top + // if start[0] is a 'unit' + // if has-canvas + // img = linear-gradient-image(start, stops) + // add-property(prop, replace(val, '__CALL__', img)) + // start = start[1] stops = normalize-stops(stops) - - // gradient image - if start[0] is a 'unit' - if has-canvas - img = linear-gradient-image(start, stops) - add-property(prop, replace(val, '__CALL__', img)) - start = start[1] - - // legacy webkit - end = grad-point(opposite-position(start)) - webkit-legacy = '-webkit-gradient(linear, %s, %s, %s)' % (grad-point(start) end join-stops(stops, webkit-stop)) - add-property(prop, replace(val, '__CALL__', webkit-legacy)) - - // vendor prefixed stops = join-stops(stops, std-stop) - for prefix in vendor-prefixes - unless prefix == official - gradient = '-%s-linear-gradient(%s, %s)' % (prefix start stops) - add-property(prop, replace(val, '__CALL__', gradient)) - - // standard 'linear-gradient(%s, %s)' % (start stops) /* diff --git a/lib/nib/vendor.styl b/lib/nib/vendor.styl index a1f9cfbd..9cd01734 100644 --- a/lib/nib/vendor.styl +++ b/lib/nib/vendor.styl @@ -75,7 +75,7 @@ prepend-args(args, prefix, argument, strict = true) * or those which should be ignored. */ -vendor(prop, args, only = null, ignore = null) +vendor(prop, args, only = null, ignore = null, vendor-property = true) for prefix in vendor-prefixes unless (only and !(prefix in only)) or (ignore and prefix in ignore) if official == prefix @@ -85,9 +85,13 @@ vendor(prop, args, only = null, ignore = null) // Adjusting the args if needed if prop in ('transition' 'transition-property') newargs = prepend-args(args, '-' + prefix + '-', transform) - if prop in ('border-image') + if prop in ('border-image' 'background' 'background-image' 'cursor' 'list-style' 'list-style-image') newargs = prepend-args(args, '-' + prefix + '-', linear-gradient, false) - {'-' + prefix + '-' + prop}: newargs + newprop = prop + newprop = '-' + prefix + '-' + prop if vendor-property + // TODO: make the adjustments for differences + // between the official syntax and vendor ones + {newprop}: newargs /* * Vendorize the given value. @@ -584,3 +588,37 @@ placeholder() else if pair is not null && pair[0] is not null {pair[0]}: type(pair[1]) == 'string' ? s(pair[1]) : pair[1] input-placeholder = placeholder + +/* + * Vendor background support (gradients). + */ + +background() + if match('-gradient\(', ''+arguments) + vendor('background', arguments, vendor-property: false) + else + background arguments + +background-image() + if match('-gradient\(', ''+arguments) + vendor('background-image', arguments, vendor-property: false) + else + background-image arguments + +cursor() + if match('-gradient\(', ''+arguments) + vendor('cursor', arguments, vendor-property: false) + else + cursor arguments + +list-style() + if match('-gradient\(', ''+arguments) + vendor('list-style', arguments, vendor-property: false) + else + list-style arguments + +list-style-image() + if match('-gradient\(', ''+arguments) + vendor('list-style-image', arguments, vendor-property: false) + else + list-style-image arguments diff --git a/test/cases/linear-gradient.styl b/test/cases/linear-gradient.styl index 692674b3..6237b5fe 100644 --- a/test/cases/linear-gradient.styl +++ b/test/cases/linear-gradient.styl @@ -1,4 +1,5 @@ +@import 'nib/vendor' @import 'nib/gradients' body @@ -22,4 +23,4 @@ body background: linear-gradient(top, white, black) body - background: linear-gradient(top, white, black), white \ No newline at end of file + background: linear-gradient(top, white, black), white From b87cf26ede2342cc388ce7d87912fa08c1667abf Mon Sep 17 00:00:00 2001 From: kizu Date: Fri, 25 May 2012 23:14:35 +0400 Subject: [PATCH 5/7] Added some tests --- test/cases/linear-gradient.css | 27 +++++++++++++++++++++++++++ test/cases/linear-gradient.styl | 14 ++++++++++++++ test/cases/multiple-gradients.css | 28 ++++++++++++++++++++++++++++ test/cases/multiple-gradients.styl | 23 +++++++++++++++++++++++ test/cases/vendor.styl | 1 + 5 files changed, 93 insertions(+) create mode 100644 test/cases/multiple-gradients.css create mode 100644 test/cases/multiple-gradients.styl diff --git a/test/cases/linear-gradient.css b/test/cases/linear-gradient.css index 078c94d9..0ce1652c 100644 --- a/test/cases/linear-gradient.css +++ b/test/cases/linear-gradient.css @@ -48,3 +48,30 @@ body { background: -o-linear-gradient(top, #fff 0, #000 100%), #fff; background: linear-gradient(top, #fff 0, #000 100%), #fff; } +body { + -webkit-border-image: -webkit-linear-gradient(top, #fff 0%, #000 100%) 20% stretch stretch; + -moz-border-image: -moz-linear-gradient(top, #fff 0%, #000 100%) 20% stretch stretch; + -o-border-image: -o-linear-gradient(top, #fff 0%, #000 100%) 20% stretch stretch; + border-image: linear-gradient(top, #fff 0%, #000 100%) 20% stretch stretch; +} +body { + cursor: -webkit-linear-gradient(40deg, #f00 0%, #0f0 100%); + cursor: -moz-linear-gradient(40deg, #f00 0%, #0f0 100%); + cursor: -ms-linear-gradient(40deg, #f00 0%, #0f0 100%); + cursor: -o-linear-gradient(40deg, #f00 0%, #0f0 100%); + cursor: linear-gradient(40deg, #f00 0%, #0f0 100%); +} +body { + list-style: -webkit-linear-gradient(40deg, #f00 0%, #0f0 100%); + list-style: -moz-linear-gradient(40deg, #f00 0%, #0f0 100%); + list-style: -ms-linear-gradient(40deg, #f00 0%, #0f0 100%); + list-style: -o-linear-gradient(40deg, #f00 0%, #0f0 100%); + list-style: linear-gradient(40deg, #f00 0%, #0f0 100%); +} +body { + list-style-image: -webkit-linear-gradient(40deg, #f00 0%, #0f0 100%); + list-style-image: -moz-linear-gradient(40deg, #f00 0%, #0f0 100%); + list-style-image: -ms-linear-gradient(40deg, #f00 0%, #0f0 100%); + list-style-image: -o-linear-gradient(40deg, #f00 0%, #0f0 100%); + list-style-image: linear-gradient(40deg, #f00 0%, #0f0 100%); +} diff --git a/test/cases/linear-gradient.styl b/test/cases/linear-gradient.styl index 6237b5fe..89c321c5 100644 --- a/test/cases/linear-gradient.styl +++ b/test/cases/linear-gradient.styl @@ -24,3 +24,17 @@ body body background: linear-gradient(top, white, black), white + +body + border-image: linear-gradient(top, #fff, #000) 20% stretch stretch; + +gradient-var = linear-gradient(40deg, red, lime) + +body + cursor: gradient-var + +body + list-style: gradient-var + +body + list-style-image: gradient-var diff --git a/test/cases/multiple-gradients.css b/test/cases/multiple-gradients.css new file mode 100644 index 00000000..bd803b58 --- /dev/null +++ b/test/cases/multiple-gradients.css @@ -0,0 +1,28 @@ +.test1 { + background: -webkit-linear-gradient(top, #fff 0%, #000 100%), -webkit-linear-gradient(bottom, #000 0%, #fff 100%); + background: -moz-linear-gradient(top, #fff 0%, #000 100%), -moz-linear-gradient(bottom, #000 0%, #fff 100%); + background: -o-linear-gradient(top, #fff 0%, #000 100%), -o-linear-gradient(bottom, #000 0%, #fff 100%); + background: -ms-linear-gradient(top, #fff 0%, #000 100%), -ms-linear-gradient(bottom, #000 0%, #fff 100%); + background: linear-gradient(top, #fff 0%, #000 100%), linear-gradient(bottom, #000 0%, #fff 100%); +} +.test2 { + background: #fff -webkit-linear-gradient(top, #000 0%, #fff 100%) 0 0 no-repeat, -webkit-linear-gradient(bottom, #000 0%, #fff 100%) 10px bottom repeat-y; + background: #fff -moz-linear-gradient(top, #000 0%, #fff 100%) 0 0 no-repeat, -moz-linear-gradient(bottom, #000 0%, #fff 100%) 10px bottom repeat-y; + background: #fff -o-linear-gradient(top, #000 0%, #fff 100%) 0 0 no-repeat, -o-linear-gradient(bottom, #000 0%, #fff 100%) 10px bottom repeat-y; + background: #fff -ms-linear-gradient(top, #000 0%, #fff 100%) 0 0 no-repeat, -ms-linear-gradient(bottom, #000 0%, #fff 100%) 10px bottom repeat-y; + background: #fff linear-gradient(top, #000 0%, #fff 100%) 0 0 no-repeat, linear-gradient(bottom, #000 0%, #fff 100%) 10px bottom repeat-y; +} +.test3 { + background-image: -webkit-linear-gradient(top, #fff 0%, #000 100%), url("a.png"), -webkit-linear-gradient(bottom, #000 0%, #fff 100%); + background-image: -moz-linear-gradient(top, #fff 0%, #000 100%), url("a.png"), -moz-linear-gradient(bottom, #000 0%, #fff 100%); + background-image: -o-linear-gradient(top, #fff 0%, #000 100%), url("a.png"), -o-linear-gradient(bottom, #000 0%, #fff 100%); + background-image: -ms-linear-gradient(top, #fff 0%, #000 100%), url("a.png"), -ms-linear-gradient(bottom, #000 0%, #fff 100%); + background-image: linear-gradient(top, #fff 0%, #000 100%), url("a.png"), linear-gradient(bottom, #000 0%, #fff 100%); +} +.test4 { + background: -webkit-linear-gradient(bottom, #000 0%, #fff 100%), -webkit-linear-gradient(top, #fff 0%, #000 100%); + background: -moz-linear-gradient(bottom, #000 0%, #fff 100%), -moz-linear-gradient(top, #fff 0%, #000 100%); + background: -o-linear-gradient(bottom, #000 0%, #fff 100%), -o-linear-gradient(top, #fff 0%, #000 100%); + background: -ms-linear-gradient(bottom, #000 0%, #fff 100%), -ms-linear-gradient(top, #fff 0%, #000 100%); + background: linear-gradient(bottom, #000 0%, #fff 100%), linear-gradient(top, #fff 0%, #000 100%); +} diff --git a/test/cases/multiple-gradients.styl b/test/cases/multiple-gradients.styl new file mode 100644 index 00000000..ea6b38ff --- /dev/null +++ b/test/cases/multiple-gradients.styl @@ -0,0 +1,23 @@ + +@import 'nib/vendor' +@import 'nib/gradients' + +.test1 + background: linear-gradient(top, white, black), + linear-gradient(bottom, black, white) + +.test2 + background: #fff \ + linear-gradient(top, black, white) 0 0 no-repeat, + linear-gradient(bottom, black, white) 10px bottom repeat-y + +.test3 + background-image: linear-gradient(top, white, black), + url(a.png), + linear-gradient(bottom, black, white) + +gradient1 = linear-gradient(top, white, black) +gradient2 = linear-gradient(bottom, black, white) + +.test4 + background: gradient2, gradient1 diff --git a/test/cases/vendor.styl b/test/cases/vendor.styl index 8e38decd..02ac391f 100644 --- a/test/cases/vendor.styl +++ b/test/cases/vendor.styl @@ -1,5 +1,6 @@ @import 'nib/vendor' +@import 'nib/gradients' vendor-prefixes = webkit moz official From f631c512418a4a97db257b3d236ba075e19d4d22 Mon Sep 17 00:00:00 2001 From: kizu Date: Mon, 13 Aug 2012 23:20:28 +0400 Subject: [PATCH 6/7] Fixed tests after rebase --- test/cases/linear-gradient.css | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/test/cases/linear-gradient.css b/test/cases/linear-gradient.css index 0ce1652c..a9f2b251 100644 --- a/test/cases/linear-gradient.css +++ b/test/cases/linear-gradient.css @@ -1,12 +1,11 @@ body { - 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%); + background: -webkit-linear-gradient(#fff, #000 100%); + background: -moz-linear-gradient(#fff, #000 100%); + background: -o-linear-gradient(#fff, #000 100%); + background: -ms-linear-gradient(#fff, #000 100%); + background: linear-gradient(#fff, #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%); From 626921de2d8ee83adb727325f4a7043bb82a42cf Mon Sep 17 00:00:00 2001 From: Sean Lang Date: Mon, 29 Jul 2013 21:14:13 -0500 Subject: [PATCH 7/7] changed `0%` to `0` to fix tests --- test/cases/linear-gradient.css | 38 ++++++++++++++--------------- test/cases/multiple-gradients.css | 40 +++++++++++++++---------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/test/cases/linear-gradient.css b/test/cases/linear-gradient.css index a9f2b251..d89f215c 100644 --- a/test/cases/linear-gradient.css +++ b/test/cases/linear-gradient.css @@ -48,29 +48,29 @@ body { background: linear-gradient(top, #fff 0, #000 100%), #fff; } body { - -webkit-border-image: -webkit-linear-gradient(top, #fff 0%, #000 100%) 20% stretch stretch; - -moz-border-image: -moz-linear-gradient(top, #fff 0%, #000 100%) 20% stretch stretch; - -o-border-image: -o-linear-gradient(top, #fff 0%, #000 100%) 20% stretch stretch; - border-image: linear-gradient(top, #fff 0%, #000 100%) 20% stretch stretch; + -webkit-border-image: -webkit-linear-gradient(top, #fff 0, #000 100%) 20% stretch stretch; + -moz-border-image: -moz-linear-gradient(top, #fff 0, #000 100%) 20% stretch stretch; + -o-border-image: -o-linear-gradient(top, #fff 0, #000 100%) 20% stretch stretch; + border-image: linear-gradient(top, #fff 0, #000 100%) 20% stretch stretch; } body { - cursor: -webkit-linear-gradient(40deg, #f00 0%, #0f0 100%); - cursor: -moz-linear-gradient(40deg, #f00 0%, #0f0 100%); - cursor: -ms-linear-gradient(40deg, #f00 0%, #0f0 100%); - cursor: -o-linear-gradient(40deg, #f00 0%, #0f0 100%); - cursor: linear-gradient(40deg, #f00 0%, #0f0 100%); + cursor: -webkit-linear-gradient(40deg, #f00 0, #0f0 100%); + cursor: -moz-linear-gradient(40deg, #f00 0, #0f0 100%); + cursor: -ms-linear-gradient(40deg, #f00 0, #0f0 100%); + cursor: -o-linear-gradient(40deg, #f00 0, #0f0 100%); + cursor: linear-gradient(40deg, #f00 0, #0f0 100%); } body { - list-style: -webkit-linear-gradient(40deg, #f00 0%, #0f0 100%); - list-style: -moz-linear-gradient(40deg, #f00 0%, #0f0 100%); - list-style: -ms-linear-gradient(40deg, #f00 0%, #0f0 100%); - list-style: -o-linear-gradient(40deg, #f00 0%, #0f0 100%); - list-style: linear-gradient(40deg, #f00 0%, #0f0 100%); + list-style: -webkit-linear-gradient(40deg, #f00 0, #0f0 100%); + list-style: -moz-linear-gradient(40deg, #f00 0, #0f0 100%); + list-style: -ms-linear-gradient(40deg, #f00 0, #0f0 100%); + list-style: -o-linear-gradient(40deg, #f00 0, #0f0 100%); + list-style: linear-gradient(40deg, #f00 0, #0f0 100%); } body { - list-style-image: -webkit-linear-gradient(40deg, #f00 0%, #0f0 100%); - list-style-image: -moz-linear-gradient(40deg, #f00 0%, #0f0 100%); - list-style-image: -ms-linear-gradient(40deg, #f00 0%, #0f0 100%); - list-style-image: -o-linear-gradient(40deg, #f00 0%, #0f0 100%); - list-style-image: linear-gradient(40deg, #f00 0%, #0f0 100%); + list-style-image: -webkit-linear-gradient(40deg, #f00 0, #0f0 100%); + list-style-image: -moz-linear-gradient(40deg, #f00 0, #0f0 100%); + list-style-image: -ms-linear-gradient(40deg, #f00 0, #0f0 100%); + list-style-image: -o-linear-gradient(40deg, #f00 0, #0f0 100%); + list-style-image: linear-gradient(40deg, #f00 0, #0f0 100%); } diff --git a/test/cases/multiple-gradients.css b/test/cases/multiple-gradients.css index bd803b58..21c4da12 100644 --- a/test/cases/multiple-gradients.css +++ b/test/cases/multiple-gradients.css @@ -1,28 +1,28 @@ .test1 { - background: -webkit-linear-gradient(top, #fff 0%, #000 100%), -webkit-linear-gradient(bottom, #000 0%, #fff 100%); - background: -moz-linear-gradient(top, #fff 0%, #000 100%), -moz-linear-gradient(bottom, #000 0%, #fff 100%); - background: -o-linear-gradient(top, #fff 0%, #000 100%), -o-linear-gradient(bottom, #000 0%, #fff 100%); - background: -ms-linear-gradient(top, #fff 0%, #000 100%), -ms-linear-gradient(bottom, #000 0%, #fff 100%); - background: linear-gradient(top, #fff 0%, #000 100%), linear-gradient(bottom, #000 0%, #fff 100%); + background: -webkit-linear-gradient(top, #fff 0, #000 100%), -webkit-linear-gradient(bottom, #000 0, #fff 100%); + background: -moz-linear-gradient(top, #fff 0, #000 100%), -moz-linear-gradient(bottom, #000 0, #fff 100%); + background: -o-linear-gradient(top, #fff 0, #000 100%), -o-linear-gradient(bottom, #000 0, #fff 100%); + background: -ms-linear-gradient(top, #fff 0, #000 100%), -ms-linear-gradient(bottom, #000 0, #fff 100%); + background: linear-gradient(top, #fff 0, #000 100%), linear-gradient(bottom, #000 0, #fff 100%); } .test2 { - background: #fff -webkit-linear-gradient(top, #000 0%, #fff 100%) 0 0 no-repeat, -webkit-linear-gradient(bottom, #000 0%, #fff 100%) 10px bottom repeat-y; - background: #fff -moz-linear-gradient(top, #000 0%, #fff 100%) 0 0 no-repeat, -moz-linear-gradient(bottom, #000 0%, #fff 100%) 10px bottom repeat-y; - background: #fff -o-linear-gradient(top, #000 0%, #fff 100%) 0 0 no-repeat, -o-linear-gradient(bottom, #000 0%, #fff 100%) 10px bottom repeat-y; - background: #fff -ms-linear-gradient(top, #000 0%, #fff 100%) 0 0 no-repeat, -ms-linear-gradient(bottom, #000 0%, #fff 100%) 10px bottom repeat-y; - background: #fff linear-gradient(top, #000 0%, #fff 100%) 0 0 no-repeat, linear-gradient(bottom, #000 0%, #fff 100%) 10px bottom repeat-y; + background: #fff -webkit-linear-gradient(top, #000 0, #fff 100%) 0 0 no-repeat, -webkit-linear-gradient(bottom, #000 0, #fff 100%) 10px bottom repeat-y; + background: #fff -moz-linear-gradient(top, #000 0, #fff 100%) 0 0 no-repeat, -moz-linear-gradient(bottom, #000 0, #fff 100%) 10px bottom repeat-y; + background: #fff -o-linear-gradient(top, #000 0, #fff 100%) 0 0 no-repeat, -o-linear-gradient(bottom, #000 0, #fff 100%) 10px bottom repeat-y; + background: #fff -ms-linear-gradient(top, #000 0, #fff 100%) 0 0 no-repeat, -ms-linear-gradient(bottom, #000 0, #fff 100%) 10px bottom repeat-y; + background: #fff linear-gradient(top, #000 0, #fff 100%) 0 0 no-repeat, linear-gradient(bottom, #000 0, #fff 100%) 10px bottom repeat-y; } .test3 { - background-image: -webkit-linear-gradient(top, #fff 0%, #000 100%), url("a.png"), -webkit-linear-gradient(bottom, #000 0%, #fff 100%); - background-image: -moz-linear-gradient(top, #fff 0%, #000 100%), url("a.png"), -moz-linear-gradient(bottom, #000 0%, #fff 100%); - background-image: -o-linear-gradient(top, #fff 0%, #000 100%), url("a.png"), -o-linear-gradient(bottom, #000 0%, #fff 100%); - background-image: -ms-linear-gradient(top, #fff 0%, #000 100%), url("a.png"), -ms-linear-gradient(bottom, #000 0%, #fff 100%); - background-image: linear-gradient(top, #fff 0%, #000 100%), url("a.png"), linear-gradient(bottom, #000 0%, #fff 100%); + background-image: -webkit-linear-gradient(top, #fff 0, #000 100%), url("a.png"), -webkit-linear-gradient(bottom, #000 0, #fff 100%); + background-image: -moz-linear-gradient(top, #fff 0, #000 100%), url("a.png"), -moz-linear-gradient(bottom, #000 0, #fff 100%); + background-image: -o-linear-gradient(top, #fff 0, #000 100%), url("a.png"), -o-linear-gradient(bottom, #000 0, #fff 100%); + background-image: -ms-linear-gradient(top, #fff 0, #000 100%), url("a.png"), -ms-linear-gradient(bottom, #000 0, #fff 100%); + background-image: linear-gradient(top, #fff 0, #000 100%), url("a.png"), linear-gradient(bottom, #000 0, #fff 100%); } .test4 { - background: -webkit-linear-gradient(bottom, #000 0%, #fff 100%), -webkit-linear-gradient(top, #fff 0%, #000 100%); - background: -moz-linear-gradient(bottom, #000 0%, #fff 100%), -moz-linear-gradient(top, #fff 0%, #000 100%); - background: -o-linear-gradient(bottom, #000 0%, #fff 100%), -o-linear-gradient(top, #fff 0%, #000 100%); - background: -ms-linear-gradient(bottom, #000 0%, #fff 100%), -ms-linear-gradient(top, #fff 0%, #000 100%); - background: linear-gradient(bottom, #000 0%, #fff 100%), linear-gradient(top, #fff 0%, #000 100%); + background: -webkit-linear-gradient(bottom, #000 0, #fff 100%), -webkit-linear-gradient(top, #fff 0, #000 100%); + background: -moz-linear-gradient(bottom, #000 0, #fff 100%), -moz-linear-gradient(top, #fff 0, #000 100%); + background: -o-linear-gradient(bottom, #000 0, #fff 100%), -o-linear-gradient(top, #fff 0, #000 100%); + background: -ms-linear-gradient(bottom, #000 0, #fff 100%), -ms-linear-gradient(top, #fff 0, #000 100%); + background: linear-gradient(bottom, #000 0, #fff 100%), linear-gradient(top, #fff 0, #000 100%); }