Graphics::Primitive::CSS - Style Graphics::Primitive documents with CSS
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);
Graphics::Primitive::CSS allows you to change the various attributes of a Graphics::Primitive document using CSS.
Graphics::Primitive::CSS currently supports a class (.classname), element (only textbox currently), and 'id' (#name) selector. It does not support nested selectors (yet).
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.
Graphics::Primitive::CSS supports the following properties in the following ways.
Background and foreground color
Color of all borders. Note: Only supports a single color value currently.
Set the color for various borders
Set the width for a border (in pixels)
Size of font as points (e.g. 7pt). Family name (does not support lists!)
2 value (top, left) and 4 value (top, right, bottom, left). Only pixels are supported.
Only pixels are supported.
Cory G Watson, <gphat at cpan.org>
<gphat at cpan.org>
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:
=back without =over
To install Graphics::Primitive::CSS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Graphics::Primitive::CSS
CPAN shell
perl -MCPAN -e shell install Graphics::Primitive::CSS
For more information on module installation, please visit the detailed CPAN module installation guide.