CSS-Tiny
view release on metacpan or search on metacpan
lib/CSS/Tiny.pm view on Meta::CPAN
$contents .= "$style {\n";
foreach ( sort keys %{ $self->{$style} } ) {
$contents .= "\t" . lc($_) . ": $self->{$style}->{$_};\n";
}
$contents .= "}\n";
}
return $contents;
}
# Generate a HTML fragment for the CSS
sub html {
my $css = $_[0]->write_string or return '';
return "<style type=\"text/css\">\n<!--\n${css}-->\n</style>";
}
# Generate an xhtml fragment for the CSS
sub xhtml {
my $css = $_[0]->write_string or return '';
return "<style type=\"text/css\">\n/* <![CDATA[ */\n${css}/* ]]> */\n</style>";
}
# Error handling
sub errstr { $CSS::Tiny::errstr }
sub _error { $CSS::Tiny::errstr = $_[1]; undef }
1;
( run in 2.270 seconds using v1.01-cache-2.11-cpan-364913b4093 )