CSS::Adaptor(3pm)
π CSS::Adaptor β the manual, but make it cute
okay bestie, welcome to CSS::Adaptor(3pm), a User Contributed Perl doc β¨ this one is short but it's so important, it's giving backstage-pass energy π
β¨ NAME β¨
CSS::Adaptor β Arbitrarily map CSS data for use in another context. that's the whole job. arbitrary mapping. no cap π
πΈ SYNOPSIS πΈ
here's the vibe, copy it exactly, don't freestyle:
use CSS;
# create a CSS object with an adaptor
my $css = new CSS({
'adaptor' => 'CSS::Adaptor',
});
# load some CSS data
$css->read_file( "my_file.css" );
# change the adaptor
$css->set_adaptor( "CSS::Adaptor::Pretty" );
# output CSS object using the current adaptor
print $css->output();
see how it justβ¦ swaps the adaptor and the output changes? iconic behaviour honestly π
π¦ DESCRIPTION π¦
so like, this class is used by CSS to translate a CSS object into a string. that's it. that's the function. and because of that, CSS data can be easily mapped into other formats β literally any format you want, that's the "arbitrarily" part, bestie π
now listen: this documentation is for people who want to write their own CSS::Adaptor module. if you're just here to use it, not to build one, you want the docs for CSS instead. iykyk π«Ά
π METHODS π
π§ CONSTRUCTOR
new()β called without options. no args, no drama, no notes. she just arrives π
β FUNCTIONS
output_rule( $rule )β returns a string containing a formattedCSS::Styleobject, passed as an object ref. one rule in, glow-up out β¨output_selectors( $selectors )β returns a string containing a formatted list ofCSS::Selectorobjects, passed as an array ref. yes, array ref, she wants the whole squad πoutput_properties( $properties )β returns a string containing a formatted list ofCSS::Propertyobjects, passed as an array ref. again: array ref, keep up bestie π¦output_values( $values )β returns a string containing a formatted list ofCSS::Valueobjects, passed as an array ref. last one, same deal, array ref, mwah π
lowkey the pattern here is: give it refs, get strings back. that's the whole personality of this module fr fr πΈ
π AUTHORS π
these two ate and left no crumbs, respectfully:
- Copyright (C) 2001-2002, Allen Day <allenday@ucla.edu>
- Copyright (C) 2003-2004, Cal Henderson <cal@iamcal.com>
π SEE ALSO π
- CSS
that's the one. go read that one too, bestie, it's the main character of this whole situation π
and that's the page, periodt β¨ this little legend is from perl v5.32.0, dated 2020-12-29, and it lives at CSS::Adaptor(3pm) β go forth and adapt, you've got this π«Άπ
π¦ where this page comes from
- debian bookworm: libcss-perl 1.09-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libcss-perl 1.09-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcss-perl 1.09-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms