diff --git a/p5-CSS-Prepare/lib/CSS/Prepare/Property/Values.pm b/p5-CSS-Prepare/lib/CSS/Prepare/Property/Values.pm index 99e3715..6622441 100644 --- a/p5-CSS-Prepare/lib/CSS/Prepare/Property/Values.pm +++ b/p5-CSS-Prepare/lib/CSS/Prepare/Property/Values.pm @@ -211,7 +211,7 @@ 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; + = qr{ (?: repeat-x | repeat-y | repeat | no-repeat | inherit ) }x; my $background_positions_horizontal = qr{ (?: left | center | centre | right ) }x; my $background_positions_vertical diff --git a/p5-CSS-Prepare/t/02.background.t b/p5-CSS-Prepare/t/02.background.t index bbaf5cc..9fff8cc 100644 --- a/p5-CSS-Prepare/t/02.background.t +++ b/p5-CSS-Prepare/t/02.background.t @@ -1,5 +1,5 @@ use Modern::Perl; -use Test::More tests => 11; +use Test::More tests => 12; use CSS::Prepare; use Data::Dumper; @@ -226,6 +226,29 @@ CSS is_deeply( \@structure, \@parsed ) or say "more shorthand was:\n" . Dumper \@parsed; } +{ + $css = < ' background: url(foo.png) repeat-x; ', + errors => [], + selectors => [ 'div' ], + block => { + 'background-attachment' => '', + 'background-color' => '', + 'background-image' => 'url(foo.png)', + 'background-position' => '', + 'background-repeat' => 'repeat-x', + }, + }, + ); + + @parsed = $preparer->parse_string( $css ); + is_deeply( \@structure, \@parsed ) + or say "more shorthand was:\n" . Dumper \@parsed; +} # shorten url() values on input {