<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Mo::utils::CSS - Mo CSS utilities.

SYNOPSIS
     use Mo::utils::CSS qw(check_array_css_color check_css_class check_css_color check_css_unit);

     check_array_css_color($self, $key);
     check_css_class($self, $key);
     check_css_color($self, $key);
     check_css_unit($self, $key);

DESCRIPTION
    Mo utilities for checking of CSS style things.

SUBROUTINES
  "check_array_css_color"
     check_array_css_color($self, $key);

    *Since version 0.03.*

    Check parameter defined by $key which is reference to array. Check if
    all values are CSS colors.

    Put error if check isn't ok.

    Returns undef.

  "check_css_class"
     check_css_class($self, $key);

    *Since version 0.02.*

    Check parameter defined by $key if it's CSS class name. Value could be
    undefined.

    Put error if check isn't ok.

    Returns undef.

  "check_css_color"
     check_css_color($self, $key);

    *Since version 0.03.*

    Check parameter defined by $key if it's CSS color. Value could be
    undefined.

    Put error if check isn't ok.

    Returns undef.

  "check_css_unit"
     check_css_unit($self, $key);

    *Since version 0.01. Described functionality since version 0.04.*

    Check parameter defined by $key if it's CSS unit. Value could be
    undefined.

    Put error if check isn't ok.

    Returns undef.

ERRORS
     check_array_css_color():
             Parameter '%s' has bad color name.
                     Value: %s
             Parameter '%s' has bad rgb color (bad hex number).
                     Value: %s
             Parameter '%s' has bad rgb color (bad length).
                     Value: %s
             Parameter '%s' must be a array.
                     Value: %s
                     Reference: %s

     check_css_class():
             Parameter '%s' has bad CSS class name.
                     Value: %s
             Parameter '%s' has bad CSS class name (number on begin).
                     Value: %s

     check_css_color():
             Parameter '%s' has bad color name.
                     Value: %s
             Parameter '%s' has bad rgb color (bad hex number).
                     Value: %s
             Parameter '%s' has bad rgb color (bad length).
                     Value: %s

     check_css_unit():
             Parameter '%s' doesn't contain number.
                     Value: %s
             Parameter '%s' doesn't contain unit.
                     Value: %s
             Parameter '%s' contain bad unit.
                     Unit: %s
                     Value: %s

EXAMPLE1
     use strict;
     use warnings;

     use Mo::utils::CSS qw(check_array_css_color);

     my $self = {
             'key' =&gt; [
                     'red',
                     '#F00', '#FF0000', '#FF000000',
                     'rgb(255,0,0)', 'rgba(255,0,0,0.3)',
                     'hsl(120, 100%, 50%)', 'hsla(120, 100%, 50%, 0.3)',
             ],
     };
     check_array_css_color($self, 'key');

     # Print out.
     print "ok\n";

     # Output:
     # ok

EXAMPLE2
     use strict;
     use warnings;

     use Error::Pure;
     use Mo::utils::CSS qw(check_array_css_color);

     $Error::Pure::TYPE = 'Error';

     my $self = {
             'key' =&gt; ['xxx'],
     };
     check_array_css_color($self, 'key');

     # Print out.
     print "ok\n";

     # Output like:
     # #Error [...utils.pm:?] Parameter 'key' has bad color name.

EXAMPLE3
     use strict;
     use warnings;

     use Mo::utils::CSS qw(check_css_class);

     my $self = {
             'key' =&gt; 'foo-bar',
     };
     check_css_class($self, 'key');

     # Print out.
     print "ok\n";

     # Output:
     # ok

EXAMPLE4
     use strict;
     use warnings;

     use Error::Pure;
     use Mo::utils::CSS qw(check_css_class);

     $Error::Pure::TYPE = 'Error';

     my $self = {
             'key' =&gt; '1xxx',
     };
     check_css_class($self, 'key');

     # Print out.
     print "ok\n";

     # Output like:
     # #Error [...utils.pm:?] Parameter 'key' has bad CSS class name (number of begin).

EXAMPLE5
     use strict;
     use warnings;

     use Mo::utils::CSS qw(check_css_color);

     my $self = {
             'key' =&gt; '#F00',
     };
     check_css_color($self, 'key');

     # Print out.
     print "ok\n";

     # Output:
     # ok

EXAMPLE6
     use strict;
     use warnings;

     use Error::Pure;
     use Mo::utils::CSS qw(check_css_color);

     $Error::Pure::TYPE = 'Error';

     my $self = {
             'key' =&gt; 'xxx',
     };
     check_css_color($self, 'key');

     # Print out.
     print "ok\n";

     # Output like:
     # #Error [...utils.pm:?] Parameter 'key' has bad color name.

EXAMPLE7
     use strict;
     use warnings;

     use Mo::utils::CSS qw(check_css_unit);

     my $self = {
             'key' =&gt; '123px',
     };
     check_css_unit($self, 'key');

     # Print out.
     print "ok\n";

     # Output:
     # ok

EXAMPLE8
     use strict;
     use warnings;

     use Error::Pure;
     use Mo::utils::CSS qw(check_css_unit);

     $Error::Pure::TYPE = 'Error';

     my $self = {
             'key' =&gt; '12',
     };
     check_css_unit($self, 'key');

     # Print out.
     print "ok\n";

     # Output like:
     # #Error [...utils.pm:?] Parameter 'key' doesn't contain unit.

DEPENDENCIES
    Error::Pure, Exporter, Graphics::ColorNames::CSS, List::Util, Mo::utils,
    Readonly.

SEE ALSO
    Mo  Micro Objects. Mo is less.

    Mo::utils
        Mo utilities.

    Mo::utils::Language
        Mo language utilities.

    Wikibase::Datatype::Utils
        Wikibase datatype utilities.

REPOSITORY
    &lt;https://github.com/michal-josef-spacek/Mo-utils-CSS&gt;

AUTHOR
    Michal Josef Ĺ&nbsp;paÄŤek &lt;mailto:skim@cpan.org&gt;

    &lt;http://skim.cz&gt;

LICENSE AND COPYRIGHT
    Â© 2023-2024 Michal Josef Ĺ&nbsp;paÄŤek

    BSD 2-Clause License

VERSION
    0.06

</pre></body></html>