CSS::Adaptor::Debug - An example adaptor for debugging CSS.


CSS documentation Contained in the CSS distribution.

Index


Code Index:

NAME

Top

CSS::Adaptor::Debug - An example adaptor for debugging CSS.

SYNOPSIS

Top

  use CSS;
  ...

DESCRIPTION

Top

This class implements a CSS::Adaptor object to display a stylesheet in 'debugging' style.

AUTHORS

Top

Copyright (C) 2003-2004, Cal Henderson <cal@iamcal.com>

SEE ALSO

Top

CSS, CSS::Adaptor


CSS documentation Contained in the CSS distribution.

package CSS::Adaptor::Debug;

$VERSION = 1.01;

use CSS::Adaptor;
@ISA = qw(CSS::Adaptor);

use strict;
use warnings;

my $DIV_LINE = ('-'x50)."\n";

sub output_rule {
	my ($self, $rule) = @_;
	return "NEW RULE\n".$DIV_LINE.$rule->selectors.$rule->properties.$DIV_LINE."\n";
}

sub output_selectors {
        my ($self, $selectors) = @_;
        return "SELECTORS:\n".join('', map {"\t".$_->{name}."\n"} @{$selectors})."\n";
}

sub output_properties {
        my ($self, $properties) = @_;
        return "PROPERTIES:\n".join('', map {"\t".$_->{property}.":\t".$_->values.";\n"} @{$properties})."\n";
}

sub output_values {
        my ($self, $values) = @_;
        return join '', map {$_->{value}} @{$values};
}


1;

__END__