1CSS::DOM::Rule::Media(3U)ser Contributed Perl DocumentatiCoSnS::DOM::Rule::Media(3)
2
3
4
6 CSS::DOM::Rule::Media - CSS @media rule class for CSS::DOM
7
9 Version 0.17
10
12 use CSS::DOM;
13 my $media_rule = CSS::DOM->parse(
14 '@media print { body { background: none } }'
15 )->cssRules->[0];
16
17 # OR:
18 use CSS::DOM::Rule::Media;
19 my $media_rule = new CSS::DOM::Rule::Media $parent;
20 push @{$media_rule->media}, 'print';
21 $media_rule->insertRule('body { background: none }')
22
24 This module implements CSS @media rules for CSS::DOM. It inherits from
25 CSS::DOM::Rule and implements the CSSMediaRule DOM interface.
26
28 media
29 Returns the MediaList associated with the @media rule (or a plain
30 list in list context). This defaults to an empty list. You can pass
31 a comma-delimited string to the MediaList's "mediaText" method to
32 set it.
33
34 cssRules
35 In scalar context, this returns a CSS::DOM::RuleList object (simply
36 a blessed array reference) of CSS::DOM::Rule objects. In list
37 context it returns a list.
38
39 insertRule ( $css_code, $index )
40 Parses the rule contained in the $css_code, inserting it the @media
41 rule's list of subrules at the given $index.
42
43 deleteRule ( $index )
44 Deletes the rule at the given $index.
45
47 CSS::DOM
48
49 CSS::DOM::Rule
50
51 CSS::DOM::MediaList
52
53
54
55perl v5.34.0 2022-01-20 CSS::DOM::Rule::Media(3)