CSS::D...diaList(3pm)

πŸ“¦
version 0.17 Β· 5 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– CSS::DOM::MediaList β€” bestie edition πŸ’–

okay so real talk, this is the medium list class for CSS::DOM. it's the thing that holds all ur media types (y'know, screen, print, all those) and it's giving iconic DOM interface energy. it implements the CSSMediaList DOM interface, and it inherits from CSS::DOM::Array, so yes, she's part of the family. 🫢

✨ VERSION ✨

Version 0.17 β€” that's the one, no cap. πŸŽ€


🌸 SYNOPSIS 🌸

here's the vibe, copy-paste ready:

use CSS::DOM;
$media_list = new CSS::DOM  ->media;

use CSS::DOM::MediaList;
$media_list = new MediaList 'screen', 'papyrus';

@media = @$media_list; # use as array
$media_list->mediaText; # returns a string
$media_list->mediaText('print, screen'); # change it
$media_list->deleteMedium('print');
$media_list->appendMedium('tv');

so like, u can grab a media list straight off a CSS::DOM object with ->media, or u can just build one urself with new MediaList 'screen', 'papyrus'. then u can use it as an array (@$media_list), read and write the mediaText string, and add or yeet media types with appendMedium and deleteMedium. slay. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

This module implements medium lists for CSS::DOM. It implements the CSSMediaList DOM interface and inherits from CSS::DOM::Array.

translation bestie: it's the medium list implementation for CSS::DOM, it does the CSSMediaList DOM interface thing, and it gets its array behaviour by inheriting from CSS::DOM::Array. lowkey a whole package. πŸ“¦βœ¨

πŸ‘‘ METHODS πŸ‘‘

πŸ’œ DOM Attributes

  • mediaText β€” a comma-and-space-separated string of all the individual media in the list, like 'screen, print'. yes, the comma AND the space, they're a package deal, don't separate them. 😭

🌈 DOM Methods

  • deleteMedium ( $name ) β€” deletes the named medium from the list, or throws an error if it cannot be found. so if it's not there, it's not gonna quietly shrug, it's gonna throw. 🚨
  • appendMedium ( $name ) β€” adds a medium to the end of the list. just... puts it at the back. no drama, no reshuffling. πŸ’«

⭐ SEE ALSO ⭐

  • CSS::DOM
  • CSS::DOM::Array

iykyk, go read those next. 🧚


and that's the whole page, bestie!! this lil doc came from perl v5.36.0, dated 2023-08-02, and it's part of the User Contributed Perl Documentation. tysm for reading, ily, go forth and manage ur media lists responsibly. πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from