CSS::Ob...Enhanced(3)

πŸ“¦ version 0.2.0, in alpine 3.24

πŸ¦‹ 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 (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