CSS::DOM::Rule::Import(3pm)

CSS::DOM::Rule::Import3pm

Css @import rule class for css::dom

Usage

  use CSS::DOM;
  my $import_rule = CSS::DOM->parse(
      '@import "print.css" print;',
      url_fetcher => sub { 
          # ... code to get the url in $_[0] ...
      }
  )->cssRules->[0];
  $import_rule->href;  # 'print.css'
  $import_rule->media; # a CSS::DOM::MediaList (array ref)
  $import_rule->styleSheet; # a CSS::DOM object

Version

Version 0.17

Overview

This module implements CSS @import rules for CSS::DOM. It inherits from CSS::DOM::Rule and implements the CSSImportRule DOM interface.

Methods

href

Returns the @import rule's URL.

media

Returns the MediaList associated with the @import rule (or a plain list in list context). This defaults to an empty list. You can pass a comma-delimited string to the MediaList's "mediaText" method to set it.

styleSheet

This returns the style sheet object, if available. Otherwise it returns an empty list (this occurs if "url_fetcher" is not provided or if it returns undef).

Releases

7 releases since Debian 7 (Wheezy); the text changed 5 times.

  1. 7
  2. 8
  3. 9
  4. 10–11
  5. 12
  6. 13

From libcss-dom-perl 0.17-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.