CSS-Prepare
view release on metacpan or search on metacpan
lib/CSS/Prepare/Property/Values.pm view on Meta::CPAN
)
}x;
our $media_types_value = qr{
$media_types
(?: \, \s* $media_types )*
}x;
# descriptive value types
our $background_attachment_value = qr{ (?: scroll | fixed | inherit ) }x;
our $background_colour_value
= qr{ (?: transparent | inherit | $colour_value ) }x;
our $background_image_value = qr{ (?: none | inherit | $url_value ) }x;
our $background_repeat_value
= qr{ (?: repeat | repeat-x | repeat-y | no-repeat | inherit ) }x;
my $background_positions_horizontal
= qr{ (?: left | center | centre | right ) }x;
my $background_positions_vertical
= qr{ (?: top | center | centre | bottom ) }x;
our $background_position_value = qr{
(?:
(?:
lib/CSS/Prepare/Property/Values.pm view on Meta::CPAN
$background_positions_horizontal
)
|
(?: $background_positions_vertical )
|
inherit
)
}x;
my $border_collapse_value = qr{ (?: collapse | separate | inherit ) }x;
our $border_colour_value = qr{ (?: transparent | inherit | $colour_value ) }x;
our $individual_border_radius_value
= qr{ (?: $positive_length_value | $positive_percentage_value ) }x;
our $border_radius_corner_value = qr{
$individual_border_radius_value
(?: \s+ $individual_border_radius_value )?
}x;
our $border_radius_value = qr{
$individual_border_radius_value
(?: \s+ $individual_border_radius_value ){0,3}
(?:
t/01.values.t view on Meta::CPAN
{
foreach my $value qw( scroll fixed inherit ) {
ok( is_background_attachment_value( $value ),
"background-attachment: '$value'" );
}
ok( ! is_background_attachment_value( 'relative' ),
"not background-attachment: 'relative'" );
# other background-color values are tested by colours above
my @colours = ( 'inherit', 'transparent', 'red', '#000' );
foreach my $value ( @colours ) {
ok( is_background_colour_value( $value ),
"background-color: '$value'" );
}
ok( ! is_background_colour_value( '#cc' ),
"not background-color: '#cc'" );
# other background-image values are tested by urls above
foreach my $value qw( none url(blah.gif) inherit ) {
t/01.values.t view on Meta::CPAN
foreach my $value qw( thin medium thick inherit 2px ) {
ok( is_border_width_value( $value ),
"border-width: '$value'" );
}
ok( ! is_border_width_value( 'stroke' ),
"not border-width: 'stroke'" );
ok( ! is_border_width_value( '-2px' ),
"not border-width: '-2px'" );
# other border-color values are tested by colours above
my @colours = ( 'inherit', 'transparent', 'red', '#000' );
foreach my $value ( @colours ) {
ok( is_border_colour_value( $value ),
"border-color: '$value'" );
}
ok( ! is_border_colour_value( '#cc' ),
"not border-color: '#cc'" );
my @corner_radii = (
'5px', '5px 2px', '.5em 1px',
);
t/01.values.t view on Meta::CPAN
}
ok( ! is_outline_width_value( 'stroke' ),
"not outline-width: 'stroke'" );
# other outline-color values are tested by colours above
my @colours = ( 'inherit', 'invert', 'red', '#000' );
foreach my $value ( @colours ) {
ok( is_outline_colour_value( $value ),
"outline-color: '$value'" );
}
ok( ! is_outline_colour_value( 'transparent' ),
"not outline-color: 'transparent'" );
ok( ! is_outline_colour_value( '#cc' ),
"not outline-color: '#cc'" );
}
( run in 0.256 second using v1.01-cache-2.11-cpan-0a6323c29d9 )