Mo-utils-CSS
view release on metacpan or search on metacpan
sub check_css_border {
my ($self, $key) = @_;
_check_key($self, $key) && return;
# Global values.
if (any { $self->{$key} eq $_ } @BORDER_GLOBAL) {
return;
}
my @parts = split m/\s+/ms, $self->{$key}, 3;
if (@parts == 1) {
_check_border_style($self->{$key}, $key);
} elsif (@parts == 2) {
# Border style on first place.
if (any { $parts[0] eq $_ } @BORDER_STYLES) {
_check_color($parts[1], $key, $self->{$key});
# Border style on second place.
} elsif (any { $parts[1] eq $_ } @BORDER_STYLES) {
;
}
} else {
err "Parameter '$key' has bad rgb color (bad length).",
'Value', $error_value,
;
}
} elsif ($value =~ m/^($funcs)\((.*)\)$/ms) {
my $func = $1;
my $args_string = $2;
my @args = split m/\s*,\s*/ms, $args_string;
if ($func eq 'rgb') {
if (@args != 3) {
err "Parameter '$key' has bad rgb color (bad number of arguments).",
'Value', $error_value,
;
}
_check_colors([@args[0 .. 2]], $key, $func, $error_value);
} elsif ($func eq 'rgba') {
if (@args != 4) {
err "Parameter '$key' has bad rgba color (bad number of arguments).",
( run in 1.085 second using v1.01-cache-2.11-cpan-71847e10f99 )