MyIntervals / PHP-CSS-Parser

A Parser for CSS Files written in PHP. Allows extraction of CSS files into a data structure, manipulation of said structure and output as (optimized) CSS

Home Page:http://www.sabberworm.com/blog/2010/6/10/php-css-parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow rgb(R G B / A) notation

jhard opened this issue · comments

commented

it's valid to write a color value as rgb(R G B / A), see MDN.

I've tackled this with a simple approach, converting it to rgba during parsing and recognizing this notation with a regexp on a peek, see this commit: jhard@a477cb4

I'm a monkey and I'm terrible at git and github (and PHP, some will say, and they're not wrong). If this approach is up to your standards, I'd be happy to create a pull request (I might need some hand-holding and encouragement, but I've done this before). If there's a better approach than using a regexp and peek, I might be able to do that, too.

It would change the CSS: rgb(R G B / A) goes in, rgba(R, G, B, A) is rendered out, I'm not sure what your policy on that is. If you don't like the conversion to rgba, I understand.

Thanks for your time!