CSS::Ob...::Format(3)
π
CSS::Object::Format β the CSS::Object::Format(3) glow-up
okay bestie, so this is the perl manpage CSS::Object::Format(3), and it's genuinely the main character of CSS stringification. Sit down, grab a strawberry π, we're doing this.
β¨ NAME β¨
CSS::Object::Format β the CSS Object Oriented Stringificator π (yes, "Stringificator" is the actual word, we don't make the rules, we just slay them)
πΈ SYNOPSIS πΈ
Here's the whole vibe, copy it exactly, no cap:
use CSS::Object::Format;
my $format = CSS::Object::Format->new( debug => 3 ) ||
die( CSS::Object::Format->error );
my $prop = CSS::Object::Property->new(
format => $format,
debug => 3,
name => 'display',
value => 'inline-block',
) || die( CSS::Object::Property->error );
print( $prop->as_string );
Likeβ¦ it makes a formatter, hands it to a property, and prints the property as a string. Iconic behavior honestly. π
β VERSION β
v0.2.0
π¦ DESCRIPTION π¦
So the page literally says: CSS::Object::Format::Inline is a CSS inline stringificator. That's it, that's the description. Short and mysterious, we respect it. π«Ά
π CONSTRUCTOR π
new
To instantiate a brand new CSS::Object::Format object, you pass an hash reference of the following parameters:
debugβ this is an integer. The bigger it is, and the more verbose is the output. That's the whole trade: bigger number = more talking. π₯
π§ PARAMETERS π§
These are the available parameters used to alter the formatting of the formatters. Each one has its own method below, so peek at those for what each actually does. π
"close_brace_on_new_line""new_line""open_brace_on_new_line""open_brace_and_new_line""indent""property_separator"
π METHODS π
backup_parameters
This will create a deep copy of this formatter's "parameters" and return it.
See "restore_parameters" β they're besties, they go together. π«Ά
close_brace_on_new_line
This takes a boolean value. If true, this will instruct the formatter to place the closing brace on a new line.
comment_as_string
Provided with a comment object, and this will return the comment formatted. π¬
copy_parameters_from
Provided with another CSS::Object::Format object, and this will copy all suitable "parameters" to it.
This is called from the format methods in CSS element classes when a new format object is provided to the element. Like passing the aux cord, but for formatting. π§
elements_as_string
Provided with an array object (Module::Generic::Array), and this will format all the elements and return a string.
indent
This is one of "parameters" that sets the string to use as indent. Indent string can be provided in rule formatter or property formatter.
This returns the current character value as a Module::Generic::Scalar object. β¨
keyframes_as_string
This formats the keyframe special rule and returns a string. Keyframes get their own little spotlight, as they deserve. π
new_line
This sets or gets the new line character to be used for new lines.
This returns the current character value as a Module::Generic::Scalar object.
open_brace_on_new_line
This takes a boolean value. If true, this will instruct the formatter to place the opening brace on a new line.
open_brace_and_new_line
This takes a boolean value. If true, this will instruct the formatter to insert a new line after the opening brace.
properties_as_string
Provided with an array reference of a CSS::Object::Property objects and this will format them and return their string representation.
property_as_string
Provided with a CSS::Object::Property object and this will format it and return its string representation.
property_separator
This sets or gets the property separator. By default, this is a new line "\n"
If you want the formatter to put all properties on a single line, you could replace this default value with an empty string. One-liner CSS era, we love to see it. π
This returns the current character value as a Module::Generic::Scalar object.
restore_parameters
Provided with an hash reference, typically that created by "backup_parameters" and this will restore this formatter's "parameters"
It returns our object. π«Ά
rule_as_string
Provided with a CSS::Object::Rule object and this will format it and return its string representation.
selectors_as_string
Provided with an array reference of a CSS::Object::Selector objects and this will format them and return their string representation.
value_as_string
Provided with a CSS::Object::Value object and this will format it and return its string representation.
values_as_string
Provided with an array reference of a CSS::Object::Value objects and this will format them and return their string representation.
π AUTHOR π
Jacques Deguest <jack@deguest.jp> β the icon behind all this. π
π SEE ALSO π
CSS::Object
π 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.
ngl that license is short and sweet and we're obsessed. no cap. π
okay bestie that's the whole page, go forth and stringify. This was perl v5.42.2, dated 2026-02-15 β mwah, see you in the group chat ππ¦β¨
π¦ 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