webcompat / css-fixme

A script that adds standardised equivalents to CSS declarations that uses only prefixed code
https://www.webcompat.com/tools/cssfixme
Mozilla Public License 2.0
9 stars 3 forks source link

Refactor code for standardizing old gradient args #8

Closed dholbert closed 9 years ago

dholbert commented 9 years ago

This patch-stack refactors the existing code for standardizing old gradient args into a helper-function.

dholbert commented 9 years ago

I sanity-checked the final cssfixme.htm with this style (exercising both a linear & radial gradient):

div {
  width: 100px;
  height: 100px;
}
.foo {
  background: -webkit-gradient(linear, left top, right bottom, from(white), to(black));
}
.bar {
  background: -webkit-gradient(radial, center center, 0, center center, 50, from(yellow), color-stop(20%, orange), color-stop(40%, red), color-stop(60%, green), color-stop(80%, blue), to(purple));
}

It's able to successfully unprefix (& the unprefixed style produces the same rendering in Firefox as the prefixed rendering produces in Chrome).