The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mojolicious::Plugin::Iconify - Iconify helpers.

SYNOPSIS

  # Mojolicious
  $self->plugin('Iconify');

  # Mojolicious::Lite
  plugin 'Iconify';

DESCRIPTION

Mojolicious::Plugin::Iconify is a Mojolicious plugin to add Iconify support in your Mojolicious application.

HELPERS

Mojolicious::Plugin::Iconify implements the following helpers.

iconify_js

  %= iconify_js
  %= iconify_js 'https://example.org/assets/js/iconify.min.js'
  %= iconify_js '/assets/js/iconify.min.js'

Generate script tag for include Iconify script file in your template.

iconify_icon

  %= iconify_icon 'logos:perl'
  %= iconify_icon 'logos:perl', size => 32
  %= iconify_icon 'logos:perl', width => 32, height => 32
  %= iconify_icon 'logos:perl', rotate => 90
  %= iconify_icon 'logos:perl', flip_horizontal => 1
  %= iconify_icon 'logos:perl', flip => 'vertical'
  %= iconify_icon 'logos:perl', align => 'right top crop'

Generate span tag with Iconify attributes.

NOTE: You can use icon alias instead of iconify_icon.

size: the icon size (eg. 16, 32px or 1em)

This is an alias for width and height attributes.

width, height: the icon width and height (eg. 16, 32px or 1em)
rotate: rotate the icon (supported values are: 90, 180 270 degrees)
flip: flip the icon in horizontal and/or vertical position
flip_horizontal: flip the icon in horizontal position

This is an alias for flip => "horizontal".

flip_vertical: flip the icon in vertical position

This is an alias for flip => "vertical".

inline: set the layout to inline (below baseline alignment)
block: set the layout to block (no vertical alignment)
align: set the vertical / horizontal alignment and cropping

(You can mix those options by separating them with comma or space)

Horizontal:

left
center (default)

Vertical:

top
middle (default)
bottom

For cropping:

crop
meet (default)

METHODS

Mojolicious::Plugin::Iconify inherits all methods from Mojolicious::Plugin and implements the following new ones.

register

  $plugin->register(Mojolicious->new);

Register helpers in Mojolicious application.

SEE ALSO

Mojolicious, Mojolicious::Guides, https://mojolicious.org, https://iconify.design/docs/.

SUPPORT

Bugs / Feature Requests

Please report any bugs or feature requests through the issue tracker at https://github.com/giterlizzi/perl-Mojolicious-Plugin-Iconify/issues. You will be notified automatically of any progress on your issue.

Source Code

This is open source software. The code repository is available for public review and contribution under the terms of the license.

https://github.com/giterlizzi/perl-Mojolicious-Plugin-Iconify

    git clone https://github.com/giterlizzi/perl-Mojolicious-Plugin-Iconify.git

AUTHORS

  • Giuseppe Di Terlizzi <gdt@cpan.org>

COPYRIGHT AND LICENSE

Copyright (c) 2020-2021, Giuseppe Di Terlizzi

This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.