NAME

CSS - an Perl object oriented interface to Cascading Style Sheets (CSS)

SYNOPSIS

use CSS;
my $css = CSS->new(
          -source  => '/path/to/some.css',
          -adaptor => 'AceGraphics');

my @styles  = $css->styles;
my $tag     = @styles[0];
my %markups = %{$css->style($tag)};

DESCRIPTION

CSS is an object-oriented Perl interface to Cascading Style Sheets (CSS). Minimally created with a CSS file, it will parse the file and return an object with methods for accessing and editing the tags extracted from the stylesheet as CSS objects. Methods are also provided to delete and add Style objects to those maintained by the CSS object.

This module does not depend on any non-standard perl modules.

METHODS

This section describes the class and object methods for a CSS object.

CONSTRUCTORS

There is only one constructor, the new() method.

$css = CSS->new(@options)

The new() method creates a new panel object. The options are a set of tag/value pairs as follows:

  Option      Value                                  Default
  ------      -----                                  -------

  -source     path to stylesheet file to be parsed.  none

  -adaptor    Adaptor to be used in creation of      default
              Styles.

  -debug      when true, debugging messages are      false
	      sent to STDERR.

new() will thow an exception if the -source tag is undefined.

ACCESSORS

The following accessor methods provide access to various attributes of the CSS object. Called with no arguments, they each return the current value of the attribute. Called with a single argument, they set the attribute and return its previous value.

Accessor Name      Description
---------------    -----------

adaptor()	      Get/set the global Style adaptor
debug()	      Get/set debug mode
source()	      Get/set the source
style(),tag()      Get/set the attributes of a Style
styles(),tags()    Get a list of all Styles
purge()            Remove a Style

BUGS

Please report them.

SEE ALSO

CSS::Style, CSS::Adaptor

AUTHOR

Allen Day <day@cshl.org>

Copyright (c) 2001 Cold Spring Harbor Laboratory

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for disclaimers of warranty.

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 203:

'=item' outside of any '=over'

Around line 221:

You forgot a '=back' before '=head2'