rafaelcaricio / gradient-parser

Parse CSS3 gradient definitions and build an AST object.
MIT License
62 stars 10 forks source link

doesnt like explicitly sized elipses... #1

Open davidosullivan opened 9 years ago

davidosullivan commented 9 years ago

I have been trying this out and its great except that this ugly gradient wont parse:-

repeating-radial-gradient(ellipse 40px 134px at 50% 96%,rgb(0, 165, 223) 0%,rgb(62, 20, 123) 6.6%,rgb(226, 0, 121) 13.2%,rgb(223, 19, 44) 18.8%,rgb(243, 239, 21) 24.1%,rgb(0, 152, 71) 33.3%)

I get the message Uncaught Error: 134px at 50% 96%,rgb(0, 165, 223) 0%,rgb(62, 20, 123) 6.6%,rgb(226, 0, 121) 13.2%,rgb(223, 19, 44) 18.8%,rgb(243, 239, 21) 24.1%,rgb(0, 152, 71) 33.3%): Missing comma before color stops

davidosullivan commented 9 years ago

fixed this one by changing

ellipse.style = matchDistance() || matchExtentKeyword();

to

ellipse.style = matchPositioning() || matchDistance() || matchExtentKeyword();