CSS::Ob...Enhanced(3)
π¦ CSS::Object::Parser::Enhanced π¦
hey bestie, you're reading CSS::Ob...Enhanced(3) from the User Contributed Perl Documentation crew β¨ this is the enhanced CSS parser page, and we're gonna get through every single detail together, no cap π
πΈ NAME πΈ
CSS::Object::Parser::Enhanced β CSS Object Oriented Enhanced Parser π
β¨ SYNOPSIS β¨
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 );
π VERSION π
v0.2.0 β she's serving version realness π
π DESCRIPTION π
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. it's giving "parse me, stringify me, keep the vibes intact" π
π§ CONSTRUCTOR π§
π new π
To instantiate a new CSS::Object::Parser::Enhanced object, pass an hash reference of following parameters:
debugβ This is an integer. The bigger it is and the more verbose is the output ππ«Ά
π METHODS π
π¦ add_rule π¦
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. iconic behavior, honestly π
π parse_element π
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 β¨
πΈ parse_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. yes bestie, rules got selectors and properties, the whole little CSS family π«Ά
π§ rule_from_token π§
Provided with a css token and this returns an adequate rule object. CSS token can be a css selector, or an at rule β
π AUTHOR π
Jacques Deguest <jack@deguest.jp> π
π SEE ALSO π
CSS::Object β the main character referenced here π
π COPYRIGHT & LICENSE π
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.
okay that's the whole manual, bestie π source/version check: perl v5.42.2, date 2026-02-15, manual CSS::Ob...Enhanced(3) β slay and goodbye π«Άπ
π¦ where this page comes from
- alpine 3.24: perl-css-object-doc 0.2.0-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms