CSS::Object::Parser::Enhanced - CSS Object Oriented Enhanced Parser
use CSS::Object; my $css = CSS::Object->new( parser => 'CSS::Object::Parser::Enhanced', format => $format_object, debug => 3, ) || die( CSS::Object->error ); $css->read( '/my/file.css' ) || die( $css->error );
v0.1.0
CSS::Object::Parser::Enhanced is a lightweight, but thorough css parser. It aims at being very reliable and fast. The elements parsed are stored in a way so they can be stringified to produce a css stylesheet very close to the one that was parsed.
To instantiate a new CSS::Object::Parser::Enhanced object, pass an hash reference of following parameters:
This is an integer. The bigger it is and the more verbose is the output.
It takes 2 parameters: string of selectors and the rule content, i.e. inside the curly braces.
It creates a new CSS::Object::Rule object, adds to it a new CSS::Object::Selector object for each selector found and also add a new CSS::Object::Property object for each property found.
It returns the rule object created.
Provided with a set of parameters as an hash reference and this parse the element and returns a hash reference with 2 properties: rule which is a CSS::Object::Rule object and pos which is an integer representing the position of the pointer in the parsed string.
Provided with some css text data and this will parse it and return an array object of CSS::Object::Rule objects. The array returned is an Module::Generic::Array object.
It does this by calling "add_rule" on each rule found in the css data provided.
Each CSS::Object::Rule object containing one more more CSS::Object::Selector objects and one or more CSS::Object::Property objects.
Provided with a css token and this returns an adequate rule object. CSS token can be a css selector, or an at rule
Jacques Deguest <jack@deguest.jp>
CSS::Object
Copyright (c) 2020 DEGUEST Pte. Ltd.
You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.
To install CSS::Object, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CSS::Object
CPAN shell
perl -MCPAN -e shell install CSS::Object
For more information on module installation, please visit the detailed CPAN module installation guide.