CSS::Adaptor(3pm)

πŸ“¦
version 1.09 Β· 4 versions
, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’… 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 formatted CSS::Style object, passed as an object ref. one rule in, glow-up out ✨
  • output_selectors( $selectors ) β€” returns a string containing a formatted list of CSS::Selector objects, passed as an array ref. yes, array ref, she wants the whole squad πŸŽ€
  • output_properties( $properties ) β€” returns a string containing a formatted list of CSS::Property objects, passed as an array ref. again: array ref, keep up bestie πŸ¦‹
  • output_values( $values ) β€” returns a string containing a formatted list of CSS::Value objects, 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