VERSION

Version 0.15

SYNOPSIS

  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

DESCRIPTION

This module implements \s-1CSS\s0 @import rules for \s-1CSS::DOM\s0. It inherits from CSS::DOM::Rule and implements the CSSImportRule \s-1DOM\s0 interface.

METHODS

href

Returns the @import rule's \s-1URL\s0.

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 \*(C`mediaText\*(C' method to set it.

styleSheet

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

RELATED TO CSS::DOM::Rule::Import…

\s-1CSS::DOM\s0

CSS::DOM::Rule

CSS::DOM::MediaList