jajuma/awesomehyva

This Magento 2 extension allows using Font Awesome 5 icons with Hyvä Themes

Installs: 16 809

Dependents: 0

Suggesters: 0

Security: 0

Stars: 10

Watchers: 1

Forks: 1

Open Issues: 0

Type:magento2-module

2.1.5 2023-11-08 06:39 UTC

This package is auto-updated.

Last update: 2024-05-22 06:58:31 UTC


README

68747470733a2f2f7777772e6a616a756d612e64652f6d656469612f777973697779672f6a616a756d612d646576656c6f702f666f6e742d617765736f6d652d69636f6e732d666f722d687976612d7468656d65732d657874656e73696f6e2d666f722d6d6167656e746f2d322f417765736f6d652d487976612d4d6f64756c652d4d6167656e746f2d322d736d616c6c2e706e67

Awesome Hyvä extension by JaJuMa allows using Font Awesome 5 & Font Awesome 6 icons as SVGs on Magento 2 & Mage-OS sites using Hyvä Themes.



Compatible with

Hyvä Themes Mage-OS Magento
68747470733a2f2f7777772e6a616a756d612e64652f6d656469612f777973697779672f6a616a756d612d73686f702f6d6167656e746f2d776974682d687976612f4a614a754d612d487976616e6175742d736d616c6c2e706e67 68747470733a2f2f7777772e6a616a756d612e64652f6d656469612f777973697779672f6a616a756d612d646576656c6f702f4d6167652d4f532d436f6d70617469626c652e737667 68747470733a2f2f7777772e6a616a756d612e64652f6d656469612f777973697779672f6a616a756d612d646576656c6f702f6d6167656e746f2d69636f6e2e737667

Features

Awesome Hyvä for Magento & Mage-OS with Hyvä Themes

  • includes 3500+ icons:
    • Font Awesome 5
      • Solid Style Icons
      • Regular Style Icons &
      • Brands Icons
    • Font Awesome 6
      • Solid Style Icons
      • Regular Style Icons &
      • Brands Icons
  • provides 6 ViewModels for adding icons in code
  • allows adding Font Awesome Icons in CMS content from Backend.

Further Info, Extension Description & Manual

Demo

Font Awesome 5 & 6 SVG icons for Hyvä Themes Demo:

Icon List

List view and detail view with all included icons for copy & paste the code to use the icons in your project:

68747470733a2f2f7777772e6a616a756d612e64652f6d656469612f777973697779672f6a616a756d612d646576656c6f702f666f6e742d617765736f6d652d69636f6e732d666f722d687976612d7468656d65732d657874656e73696f6e2d666f722d6d6167656e746f2d322f617765736f6d652d687976612d69636f6e2d6c6973742d64656d6f2d6c617267652e6a7067

Installation

Install via composer as any other Magento extension from github:

composer require jajuma/awesomehyva

or get it from Extension Website for manual installation in app/code/ as any other Magento extension.

⚠️ Version 2.0.0+ requires Hyvä Theme Version >=1.1.12

Using Font Awesome icons in Hyvä Themes with JaJuMa "Awesome Hyvä" module

How to use Font Awesome icons in Hyvä Themes in view models

JaJuMa "Awesome Hyvä" module provides 6 view models:

  • For Font Awesome v5:

    • AwesomeiconsSolid
    • AwesomeiconsRegular
    • AwesomeiconsBrands
  • For Font Awesome v6:

    • Awesomeicons6Solid
    • Awesomeicons6Regular
    • Awesomeicons6Brands

Require one of the view models in your template:

  • For Font Awesome v5:
/** @var \Jajuma\AwesomeHyva\ViewModel\AwesomeiconsSolid $awesomeiconsSolid */
$awesomeiconsSolid = $viewModels->require(\Jajuma\AwesomeHyva\ViewModel\AwesomeiconsSolid::class);
/** @var \Jajuma\AwesomeHyva\ViewModel\AwesomeiconsRegular $awesomeiconsRegular */
$awesomeiconsRegular = $viewModels->require(\Jajuma\AwesomeHyva\ViewModel\AwesomeiconsRegular::class);
/** @var \Jajuma\AwesomeHyva\ViewModel\AwesomeiconsBrands $awesomeiconsBrands */
$awesomeiconsBrands = $viewModels->require(\Jajuma\AwesomeHyva\ViewModel\AwesomeiconsBrands::class);
  • For Font Awesome v6:
/** @var \Jajuma\AwesomeHyva\ViewModel\Awesomeicons6Solid $awesomeicons6Solid */
$awesomeicons6Solid = $viewModels->require(\Jajuma\AwesomeHyva\ViewModel\Awesomeicons6Solid::class);
/** @var \Jajuma\AwesomeHyva\ViewModel\Awesomeicons6Regular $awesomeicons6Regular */
$awesomeicons6Regular = $viewModels->require(\Jajuma\AwesomeHyva\ViewModel\Awesomeicons6Regular::class);
/** @var \Jajuma\AwesomeHyva\ViewModel\Awesomeicons6Brands $awesomeicons6Brands */
$awesomeicons6Brands = $viewModels->require(\Jajuma\AwesomeHyva\ViewModel\Awesomeicons6Brands::class);

Then render the icons like this:

<?= $awesomeiconsRegular->addressBookHtml('text-red-100', 24, 24) ?>
<?= $awesomeicons6Regular->addressBookHtml('text-red-100', 24, 24) ?>
  • The method name is the camel cased icon name, followed by Html.
  • In an IDE you should have autocompletion for all available methods.
  • The parameters are optional, and change the class (in single quotes) followed by 2 values for width and height attributes of the SVG element.
  • It is recommended to set all of them, so that the images are not rendered in huge sizes if CSS fails to load.

or you may also pass additional attributes like this as an array:

<?= $awesomeiconsRegular->addressBookHtml('text-red-100', 24, 24, ['style'=>'position:relative']) ?>
<?= $awesomeicons6Regular->addressBookHtml('text-red-100', 24, 24, ['style'=>'position:relative']) ?>

How to use Font Awesome icons in Hyvä Themes in CMS content

Awesome Hyvä module adds an icon directive to render icons in filtered content like CMS blocks or pages. So you may add icons in text / code blocks like this:

Release <= 1.0.1

{{awesome "solid/address-book" classes="text-red-100" width=12 height=12}}

Release >= 2.0.0

{{icon "awesomeicons/solid/address-book" classes="text-red-100" width=12 height=12}}
{{icon "awesomeicons6/solid/address-book" classes="text-red-100" width=12 height=12}}
  • "classes" parameter is used for setting any css class.
  • "width"/"height" parameters are used for setting width/height attributes for icons.
  • Hint: You may get the code snippets for copy & paste for each icon on the demo - see link below.

License

The code is licensed under the MIT License (MIT)

Other Magento 2 & Hyvä Themes Extensions by JaJuMa

Other Services by JaJuMa

© JaJuMa GmbH | www.jajuma.de