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
http://www.sabberworm.com/blog/2010/6/10/php-css-parser
MIT License
1.73k stars 146 forks source link

Rework our class structure and naming to match the official specs #613

Open oliverklee opened 3 weeks ago

oliverklee commented 3 weeks ago

https://www.w3.org/TR/cssom-1/ https://www.w3.org/TR/css-syntax-3/

We'll probably need to use PHP class aliases and deprecate a lot of things.

JakeQZ commented 3 weeks ago

I'm not so sure.

The referenced documents are not an object model, but a syntax.

Current class hierarchy seems to fit. At least for me. But, yes, please review.

JakeQZ commented 3 weeks ago

Actually, I think there are some misnomers. E.g. the current Rule\Rule class should be a Declaration or CssDeclaration in some namespace (ref). And the Rule and Property namespaces seem to be transposed from their current official definitions: a 'rule' is an enclosing block; a 'property' is a single value.