The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Graphics::Primitive::CSS - Style Graphics::Primitive documents with CSS

SYNOPSIS

    use Graphics::Primitive::CSS;

    my $styler = Graphics::Primitive::CSS->new(
        style => '
            .foo {
                font-size: 12pt;
                vertical-align: center;
            }
        '
    );

    my $doc = Graphics::Primitive::Container->new;
    my $textbox = Graphics::Primitive::TextBox->new( class => 'foo' );
    $doc->add_component($textbox);

    $styler->apply($doc);

DESCRIPTION

Graphics::Primitive::CSS allows you to change the various attributes of a Graphics::Primitive document using CSS.

SELECTORS

Graphics::Primitive::CSS currently supports a class (.classname), element (only textbox currently), and 'id' (#name) selector. It does not support nested selectors (yet).

COLORS

Colors can be suppled as an RBG hex triplet (#f0f0f0 and #fff) and W3C spec name (aliceblue). Support is intended for rgb, rgba, hsl and hsla.

PROPERTIES

Graphics::Primitive::CSS supports the following properties in the following ways.

background-color, color

Background and foreground color

border-color

Color of all borders. Note: Only supports a single color value currently.

border-color-top, border-color-right, border-color-bottom, border-color-left

Set the color for various borders

border-width-top, border-width-right, border-width-bottom, border-width-left

Set the width for a border (in pixels)

font-size, font-family

Size of font as points (e.g. 7pt). Family name (does not support lists!)

margin

2 value (top, left) and 4 value (top, right, bottom, left). Only pixels are supported.

margin-top, margin-left, margin-bottom, margin-right
padding

2 value (top, left) and 4 value (top, right, bottom, left). Only pixels are supported.

padding-top, padding-left, padding-bottom, padding-right

Only pixels are supported.

AUTHOR

Cory G Watson, <gphat at cpan.org>

COPYRIGHT & LICENSE

Copyright 2009 Cold Hard Code, LLC, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 427:

=back without =over