Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion p5-CSS-Prepare/lib/CSS/Prepare/Property/Values.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 24 additions & 1 deletion p5-CSS-Prepare/t/02.background.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use Modern::Perl;
use Test::More tests => 11;
use Test::More tests => 12;

use CSS::Prepare;
use Data::Dumper;
Expand Down Expand Up @@ -226,6 +226,29 @@ CSS
is_deeply( \@structure, \@parsed )
or say "more shorthand was:\n" . Dumper \@parsed;
}
{
$css = <<CSS;
div { background: url(foo.png) repeat-x; }
CSS
@structure = (
{
original => ' 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
{
Expand Down