CSS-Simple

 view release on metacpan or  search on metacpan

lib/CSS/Simple.pm  view on Meta::CPAN

package CSS::Simple;
use strict;
use warnings;

our $VERSION = '3224';

use Carp;

use Tie::IxHash;
use Storable qw(dclone);
use Ref::Util qw(is_plain_arrayref is_plain_hashref);

=pod

=head1 NAME

CSS::Simple - Interface through which to read/write/manipulate CSS files while respecting the cascade order

=head1 SYNOPSIS

 use CSS::Simple;

 my $css = new CSS::Simple();

 $css->read_file({ filename => 'input.css' });

 #perform manipulations...

 $css->write_file({ filename => 'output.css' });

=head1 DESCRIPTION

Class for reading, manipulating and writing CSS. Unlike other CSS classes on CPAN this particular module
focuses on respecting the order of selectors while providing a common sense API through which to manipulate the
rules.

Please note that while ordering is respected, the exact order of selectors may change. I.e. the rules
implied by the styles and their ordering will not change, but the actual ordering of the styles may shift around.
See the read method for more information.

=cut

BEGIN {
  my $members = ['ordered','stylesheet','warns_as_errors','content_warnings','browser_specific_properties', 'allow_duplicate_properties'];

  #generate all the getter/setter we need
  foreach my $member (@{$members}) {
    no strict 'refs';                                                                                

    *{'_' . $member} = sub {
      my ($self,$value) = @_;

      $self->_check_object();

      $self->{$member} = $value if defined($value);

      return $self->{$member};
    }
  }
}


=pod

=head1 CONSTRUCTOR

=over 4

=item new ([ OPTIONS ])

Instantiates the CSS::Simple object. Sets up class variables that are used during file parsing/processing.



( run in 1.594 second using v1.01-cache-2.11-cpan-39bf76dae61 )