1CSS::DOM::Rule::Import(U3s)er Contributed Perl DocumentatCiSoSn::DOM::Rule::Import(3)
2
3
4
6 CSS::DOM::Rule::Import - CSS @import rule class for CSS::DOM
7
9 Version 0.17
10
12 use CSS::DOM;
13 my $import_rule = CSS::DOM->parse(
14 '@import "print.css" print;',
15 url_fetcher => sub {
16 # ... code to get the url in $_[0] ...
17 }
18 )->cssRules->[0];
19
20 $import_rule->href; # 'print.css'
21 $import_rule->media; # a CSS::DOM::MediaList (array ref)
22 $import_rule->styleSheet; # a CSS::DOM object
23
25 This module implements CSS @import rules for CSS::DOM. It inherits from
26 CSS::DOM::Rule and implements the CSSImportRule DOM interface.
27
29 href
30 Returns the @import rule's URL.
31
32 media
33 Returns the MediaList associated with the @import rule (or a plain
34 list in list context). This defaults to an empty list. You can pass
35 a comma-delimited string to the MediaList's "mediaText" method to
36 set it.
37
38 styleSheet
39 This returns the style sheet object, if available. Otherwise it
40 returns an empty list (this occurs if "url_fetcher" is not provided
41 or if it returns undef).
42
44 CSS::DOM
45
46 CSS::DOM::Rule
47
48 CSS::DOM::MediaList
49
50
51
52perl v5.34.0 2021-07-22 CSS::DOM::Rule::Import(3)