NAME

CSS::Object::Property - CSS Object Oriented Property

SYNOPSIS

use CSS::Object::Property;
my $prop = CSS::Object::Property->new(
    name => 'display',
    value => 'inline-block',
    format => $format_object,
    debug => 3,
) || die( CSS::Object::Property->error );

VERSION

v0.2.0

DESCRIPTION

CSS::Object::Property is a class to represent a CSS property.

CONSTRUCTOR

new

To instantiate a new CSS::Object::Property object, pass an hash reference of following parameters:

debug

This is an integer. The bigger it is and the more verbose is the output.

format

This is a CSS::Object::Format object or one of its child modules.

name

This is the property's name. When provided, this calls the method "name" to store the value.

value

This is the property's name. When provided, this calls the method "value" to store the value.

METHODS

format

This is a CSS::Object::Format object or one of its child modules.

as_string

This calls the "format" and its method "property_as_string" in CSS::Object::Format

It returns the css string produced or undef and sets an Module::Generic::Exception upon error.

format

This sets or gets the CSS::Object::Format object. When set, this will share the formatter with all its CSS::Object::Value objects.

name

Sets or gets the property's name. The name stored here becomes a Module::Generic::Scalar and thus all its object methods can be used

remove_from

This takes an CSS::Object::Rule object as single argument and remove this property object from its list of elements.

It basically does:

$rule->elements->remove( $self );

It returns the current property object.

value

Sets the value or get the last value for this property.

It takes either a string or a CSS::Object::Value object and add it to the list of stored values for this property using the "properties" method.

It returns the last property value object in the "values" array.

values

This sets or gets the list of CSS::Object::Value objects. It uses a Module::Generic::Array object to store those value objects.

It returns the array object.

values_as_string

This returns a string representation of all the CSS::Object::Value objects currently stored. It does this by calling the format's method "values_as_string" in CSS::Object::Format

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

CSS::Object

COPYRIGHT & LICENSE

Copyright (c) 2020 DEGUEST Pte. Ltd.

You can use, copy, modify and redistribute this package and associated files under the same terms as Perl itself.