CSS::Object::Value(3)
β¨ NAME β¨
okay bestie, welcome to the User Contributed Perl Documentation page for CSS::Object::Value(3) π
CSS::Object::Value β CSS Object Oriented Value. That's the whole vibe: it's the module that holds a CSS property's value. Slay.
π¦ SYNOPSIS π¦
use CSS::Object::Value;
# For font-size property for example
my $val = CSS::Object::Value->new( '1.2rem',
debug => 3,
format => $format_object,
) || die( CSS::Object::Value->error );
# Adding value with comment inside
my $val = CSS::Object::Value->new( '1.2rem', with_comment =>
{
before => 'This is 12px',
after => ["Might want to change this", "to something else"],
}) || die( "Cannot add value with comments: ", CSS::Object::Value->error );
my $val = CSS::Object::Value->new( '/* Might need to change this */ 1.2rem /* Maybe move this to px instead? */',
debug => 3,
format => $format_object,
) || die( CSS::Object::Value->error );
# or
$val->comment_before->push( $css->new_comment( "More comment before value" ));
#val->comment_after->push( $css->new_comment( "Another comment after too" ));
# or
$val->with_comment({
before => 'This is 12px',
after => ["Might want to change this", "to something else"],
}) || die( $val->error );
β VERSION β
v0.2.0 β periodt π
π DESCRIPTION π
CSS::Object::Value is a module to contain the CSS properties' value. Literally its whole job. Iconic, focused, no notes. π
π CONSTRUCTOR π
π£ new
To instantiate a new CSS::Object::Value object, pass a hash reference with these parameters, bestie:
debugβ this is an integer. The bigger it is, the more verbose the output gets. It's giving "turn the volume up" energy π₯formatβ this is aCSS::Object::Formatobject or one of its child modules.valueβ the property value, which can also be called as the sole argument:
# For display property for example
my $val = CSS::Object::Value->new( 'none' );
with_commentβ this parameter must be a hash reference with 2 possible properties:beforeandafter. Each of those properties can contain either a simple string, an array reference of string, or anCSS::Object::Commentobject.
It returns our object π«Ά
πΈ METHODS πΈ
as_string
This calls the format object and its value_as_string method in CSS::Object::Format.
It returns the CSS string produced, or undef, and sets a Module::Generic::Exception upon error. No cap, that's the deal. π
format
This is a CSS::Object::Format object or one of its child modules.
value
Sets or gets the value for this property value. The value stored here becomes a Module::Generic::Scalar, and thus all its object methods can be used β¨
Alternatively, it accepts a CSS::Object::Value and will call its value method to get the actual string to store.
It returns the value currently stored. Simple, clean, main character behavior π
with_comment
This method takes a hash reference with 2 possible properties: before and after. Each of those properties can contain either a simple string, an array reference of string, or an CSS::Object::Comment object.
It returns the object used to call this method, or undef if there was an error. π¦
π AUTHOR π
Jacques Deguest <jack@deguest.jp> β the author himself, bestie. Respect the icon π
π SEE ALSO π
CSS::Object β go peek, iykyk π
π 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 page. This one was served up for perl v5.42.2, dated 2026-02-15, and it's giving CSS::Object::Value(3) energy. bye bestie π«Άπ
π¦ 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