|
NAMECSS::Croco - Quick CSS parserSYNOPSISmy $parser = CSS::Croco->new; my $stylesheet = $parser->parse( ' @charset "windows-1251"; * { color: red; background-color: black; fint-size: 12px !important} p { padding: 0 } ' ); my @rules = $stylesheet->rules; my $decls = $rules[2]->declarations; say $decls->to_string(0) # padding : 0; my $list = CSS::Croco::DeclarationList->parse( 'border: solid 1px; border: solid 2px;' ); say $list->property( 'border')->to_string # 'border : solid 1px'; DESCRIPTIONThis module is an interface to libcroco, providing CSS parser with CSS Object Model. This is early release, some functionality was not completed. Especially - CSS SAX Parser.METHODSnewArgs: noneCreates new instance of CSS::Croco parseArgs: $stringParses string $string and returns CSS::Croco::StyleSheet object. parse_fileArgs: $filenameParses file $filename and returns CSS::Croco::StyleSheet object. SEE ALSOCSS, CSS::DOMAUTHORAndrey Kostenko, <andrey@kostenko.name>COPYRIGHT AND LICENSECopyright (C) 2009 by Andrey KostenkoThis library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available.
Visit the GSP FreeBSD Man Page Interface. |