CSS::D...diaList(3pm)
π 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 forCSS::DOM, it does theCSSMediaListDOM interface thing, and it gets its array behaviour by inheriting fromCSS::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::DOMCSS::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
- debian trixie: libcss-dom-perl 0.17-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcss-dom-perl 0.17-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcss-dom-perl 0.17-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcss-dom-perl 0.17-3 Β· 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