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
or1em
)-
This is an alias for
width
andheight
attributes. width
,height
: the icon width and height (eg.16
,32px
or1em
)rotate
: rotate the icon (supported values are:90
,180
270
degrees)flip
: flip the icon inhorizontal
and/orvertical
positionflip_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:
Vertical:
For cropping:
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.